ddbconversions

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 2 Imported by: 0

README

CI PkgGoDev

go-dynamodb-attribute-conversions

go get github.com/aereal/go-dynamodb-attribute-conversions

Usage

import (
  "context"

  "github.com/aereal/go-dynamodb-attribute-conversions"
  "github.com/aws/aws-lambda-go/events"
  "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute"
)

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
    }
    dynamodbattribute.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) *dynamodb.AttributeValue

AttributeValueFrom converts from events.DynamoDBAttributeValue to dynamodb.AttributeValue

func AttributeValueMapFrom

func AttributeValueMapFrom(from map[string]events.DynamoDBAttributeValue) map[string]*dynamodb.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