# README
go-dynamodb-attribute-conversions
go get github.com/aereal/go-dynamodb-attribute-conversions/v2
Usage
import (
"context"
"github.com/aereal/go-dynamodb-attribute-conversions/v2"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue"
)
func handler(ctx context.Context, event events.DynamoDBEvent) error {
for _, record := range event.Records {
m := ddbconversions.AttributeValueMapFrom(record.Change.NewImage)
var item struct{
Bool bool
Str string
}
attributevalue.UnmarshalMap(m, &item)
}
return nil
}
License
See LICENSE file.
# Functions
AttributeValueFrom converts from events.DynamoDBAttributeValue to dynamodb.AttributeValue.
AttributeValueMapFrom converts from events.DynamoDBAttributeValuemap to dynamodb.AttributeValue map.