MCPcopy
hub / github.com/aws/aws-lambda-go / Integer

Method Integer

events/attributevalue.go:86–94  ·  view source on GitHub ↗

Integer provides access to an attribute of type Number. DynamoDB sends the values as strings. For convenience this method provides conversion to int. If the value cannot be represented by a signed integer, err.Err = ErrRange and the returned value is the maximum magnitude integer of an int64 of the

()

Source from the content-addressed store, hash-verified

84// of an int64 of the appropriate sign.
85// Method panics if the attribute is not of type Number.
86func (av DynamoDBAttributeValue) Integer() (int64, error) {
87 number := av.Number()
88 value, err := av.Int64()
89 if err == nil {
90 return value, nil
91 }
92 s, err := strconv.ParseFloat(number, 64)
93 return int64(s), err
94}
95
96// Float provides access to an attribute of type Number.
97// DynamoDB sends the values as strings. For convenience this method

Calls 2

NumberMethod · 0.95
Int64Method · 0.95