Documentation ¶
Index ¶
- Variables
- func ConvertAVValue(data map[string]types.AttributeValue) (map[string]AVer, error)
- func ConvertAVValues(data []map[string]types.AttributeValue) ([]map[string]AVer, error)
- func FlattenAttrList(data []map[string]types.AttributeValue) ([]map[string]any, error)
- func FlattenAttrValue(data map[string]types.AttributeValue) (map[string]any, error)
- func JSONStringify(v any) string
- func ScanIterator(ctx context.Context, scanner Scanner) func(input *ddb.ScanInput) (*ddb.ScanOutput, error, bool)
- type AVBool
- type AVByte
- type AVByteSet
- type AVList
- type AVMap
- type AVNull
- type AVNumber
- type AVNumberSet
- type AVString
- type AVStringSet
- type AVer
- type Client
- func (c *Client) BatchDeleteItems(ctx context.Context, tableName string, keys []map[string]types.AttributeValue) (*ddb.BatchWriteItemOutput, error)
- func (c *Client) Put(ctx context.Context, input *ddb.PutItemInput) (*ddb.PutItemOutput, error)
- func (c *Client) Scan(ctx context.Context, input *ddb.ScanInput) (*ddb.ScanOutput, error)
- type Scanner
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoItems = errors.New("no items found")
)
Functions ¶
func ConvertAVValue ¶ added in v0.2.5
func ConvertAVValues ¶ added in v0.2.5
func FlattenAttrList ¶ added in v0.2.0
FlattenAttrList - flattens the given attribute value list.
func FlattenAttrValue ¶ added in v0.2.0
FlattenAttrValue - flattens the given attribute value map. Removes the "Value" attribute from the AttributeValueMember struct and returns the value as a map[string]any.
func JSONStringify ¶
JSONStringify - returns a json string representation of the given value
func ScanIterator ¶ added in v0.2.0
func ScanIterator(ctx context.Context, scanner Scanner) func(input *ddb.ScanInput) (*ddb.ScanOutput, error, bool)
ScanIterator - Creates an iterator function for a DynamoDB scan function. The iterator function will return the next page of results on each call, until there are no more results. If the iterator is done, the output will be nil and, the last return value will be true.
Example:
next := dynamodb.ScanIterator(ctx, scanner) input := &ddb.ScanInput{ TableName: aws.String("my-table"), } output, err, done := next(input)
Types ¶
type AVNumberSet ¶ added in v0.2.5
type AVNumberSet struct {
NS []string
}
func (AVNumberSet) IsAV ¶ added in v0.2.5
func (ns AVNumberSet) IsAV() bool
type AVStringSet ¶ added in v0.2.5
type AVStringSet struct {
SS []string
}
func (AVStringSet) IsAV ¶ added in v0.2.5
func (ss AVStringSet) IsAV() bool
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - dynamodb client to query the table (get,put,query,scan)
func NewWith ¶
func NewWith(ctx context.Context, configOpts func(*config.LoadOptions) error, dbOpts ...func(*ddb.Options)) (*Client, error)
NewWith - creates a new dynamodb client with exposed functional options. Use this client if you wish to have flexibility with some of the more advanced options.
func (*Client) BatchDeleteItems ¶
func (c *Client) BatchDeleteItems(ctx context.Context, tableName string, keys []map[string]types.AttributeValue) (*ddb.BatchWriteItemOutput, error)
BatchDeleteItems - deletes items in a batch Note, max size is 25 items within a batch
func (*Client) Put ¶ added in v0.2.0
func (c *Client) Put(ctx context.Context, input *ddb.PutItemInput) (*ddb.PutItemOutput, error)
Put - puts an item into a dynamodb table