Documentation ¶
Index ¶
- func ConvertFrom(item *dynamodb.AttributeValue, v interface{}) (err error)
- func ConvertFromList(item []*dynamodb.AttributeValue, v interface{}) (err error)
- func ConvertFromMap(item map[string]*dynamodb.AttributeValue, v interface{}) (err error)
- func ConvertTo(in interface{}) (item *dynamodb.AttributeValue, err error)
- func ConvertToList(in interface{}) (item []*dynamodb.AttributeValue, err error)
- func ConvertToMap(in interface{}) (item map[string]*dynamodb.AttributeValue, err error)
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.