Registry / cloud / aws-aws-sdk-go-v2-feature-dynamodb-attributevalue

aws-aws-sdk-go-v2-feature-dynamodb-attributevalue

JSON →
library1.20.48gogounverified

Package attributevalue provides marshaling and unmarshaling utilities to convert between Go types and Amazon DynamoDB AttributeValues.

go get github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue
INSTALL
IMPORT
SIG · AWS-AWS-SDK-GO-V2-
A
aws-aws-sdk-go-v2-feature-dynamodb-attributevalue
cloudgov1.20.48
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

attributevalue
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue

Marshal a Go struct to DynamoDB AttributeValues and put an item.

package main import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue" "github.com/aws/aws-sdk-go-v2/service/dynamodb" ) type Item struct { PK string `dynamodbav:"pk"` Name string `dynamodbav:"name"` } func main() { cfg, err := config.LoadDefaultConfig(context.TODO()) if err != nil { panic(err) } client := dynamodb.NewFromConfig(cfg) item := Item{PK: "123", Name: "Example"} av, err := attributevalue.MarshalMap(item) if err != nil { panic(err) } _, err = client.PutItem(context.TODO(), &dynamodb.PutItemInput{ TableName: aws.String("MyTable"), Item: av, }) if err != nil { panic(err) } fmt.Println("Item put successfully") }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.20.48latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
30
OpenAI (training)
3
Resources
aws-aws-sdk-go-v2-feature-dynamodb-attributevalue — go get aws-aws-sdk-go-v2-feature-dynamodb-attributevalue · libregistry