File: doc.go

package info (click to toggle)
golang-github-aws-aws-sdk-go 1.1.14%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 25,048 kB
  • ctags: 30,114
  • sloc: ruby: 193; makefile: 98
file content (60 lines) | stat: -rw-r--r-- 2,370 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Package dynamodbattribute provides marshaling utilities for marshaling to
// dynamodb.AttributeValue types and unmarshaling to Go value types. These
// utilities allow you to marshal slices, maps, structs, and scalar values
// to and from dynamodb.AttributeValue. These are useful when marshaling
// Go value tyes to dynamodb.AttributeValue for DynamoDB requests, or
// unmarshaling the dynamodb.AttributeValue back into a Go value type.
//
// Marshal Go value types to dynamodb.AttributeValue: See (ExampleMarshal)
//
//     type Record struct {
//         MyField string
//         Letters []string
//         A2Num   map[string]int
//     }
//
//     ...
//
//     r := Record{
//         MyField: "dynamodbattribute.Marshal example",
//         Letters: []string{"a", "b", "c", "d"},
//         A2Num:   map[string]int{"a": 1, "b": 2, "c": 3},
//     }
//     av, err := dynamodbattribute.Marshal(r)
//     fmt.Println(av, err)
//
// Unmarshal dynamodb.AttributeValue to Go value type: See (ExampleUnmarshal)
//
//     r2 := Record{}
//     err = dynamodbattribute.Unmarshal(av, &r2)
//     fmt.Println(err, reflect.DeepEqual(r, r2))
//
// Marshal Go value type for DynamoDB.PutItem:
//
//     sess := session.New()
//     svc := dynamodb.New(sess)
//     item, err := dynamodbattribute.MarshalMap(r)
//     if err != nil {
//         fmt.Println("Failed to convert", err)
//         return
//     }
//     result, err := svc.PutItem(&dynamodb.PutItemInput{
//         Item:      item,
//         TableName: aws.String("exampleTable"),
//     })
//
//
//
// The ConvertTo, ConvertToList, ConvertToMap, ConvertFrom, ConvertFromMap
// and ConvertFromList methods have been deprecated. The Marshal and Unmarshal
// functions should be used instead. The ConvertTo|From marshallers do not
// support BinarySet, NumberSet, nor StringSets, and will incorrect marshal
// binary data fields in structs as base64 strings.
//
// The Marshal and Unmarshal functions correct this behavior, and removes
// the reliance on encoding.json. `json` struct tags are still supported. In
// addition support for a new struct tag `dynamodbav` was added. Support for
// the json.Marshaler and json.Unmarshaler interfaces have been removed and
// replaced with have been replaced with dynamodbattribute.Marshaler and
// dynamodbattribute.Unmarshaler interfaces.
package dynamodbattribute