ddbconversions

package module
v2.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 3 Imported by: 0

README

CI PkgGoDev

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeValueFrom

func AttributeValueFrom(from events.DynamoDBAttributeValue) types.AttributeValue

AttributeValueFrom converts from events.DynamoDBAttributeValue to dynamodb.AttributeValue

func AttributeValueMapFrom

func AttributeValueMapFrom(from map[string]events.DynamoDBAttributeValue) map[string]types.AttributeValue

AttributeValueMapFrom converts from events.DynamoDBAttributeValuemap to dynamodb.AttributeValue map

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL