dynamodbattribute

package
v0.6.5-0...-b8f7556 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFrom

func ConvertFrom(item *dynamodb.AttributeValue, v interface{}) (err error)

ConvertFrom accepts a *dynamodb.AttributeValue and converts it to any interface{}.

If v contains any structs, the result is first converted it to a interface{}, then JSON encoded/decoded it to convert to a struct, so `json` struct tags are respected.

func ConvertFromList

func ConvertFromList(item []*dynamodb.AttributeValue, v interface{}) (err error)

ConvertFromList accepts a []*dynamodb.AttributeValue and converts it to an array or slice.

If v contains any structs, the result is first converted it to a []interface{}, then JSON encoded/decoded it to convert to a typed array or slice, so `json` struct tags are respected.

func ConvertFromMap

func ConvertFromMap(item map[string]*dynamodb.AttributeValue, v interface{}) (err error)

ConvertFromMap accepts a map[string]*dynamodb.AttributeValue and converts it to a map[string]interface{} or struct.

If v points to a struct, the result is first converted it to a map[string]interface{}, then JSON encoded/decoded it to convert to a struct, so `json` struct tags are respected.

func ConvertTo

func ConvertTo(in interface{}) (item *dynamodb.AttributeValue, err error)

ConvertTo accepts any interface{} and converts it to a *dynamodb.AttributeValue.

If in contains any structs, it is first JSON encoded/decoded it to convert it to a interface{}, so `json` struct tags are respected.

func ConvertToList

func ConvertToList(in interface{}) (item []*dynamodb.AttributeValue, err error)

ConvertToList accepts an array or slice and converts it to a []*dynamodb.AttributeValue.

If in contains any structs, it is first JSON encoded/decoded it to convert it to a []interface{}, so `json` struct tags are respected.

func ConvertToMap

func ConvertToMap(in interface{}) (item map[string]*dynamodb.AttributeValue, err error)

ConvertToMap accepts a map[string]interface{} or struct and converts it to a map[string]*dynamodb.AttributeValue.

If in contains any structs, it is first JSON encoded/decoded it to convert it to a map[string]interface{}, so `json` struct tags are respected.

Types

This section is empty.

Jump to

Keyboard shortcuts

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