Documentation ¶
Overview ¶
Support for the DynamoDB BatchGetItem endpoint. This package offers support for request sizes that exceed AWS limits.
example use:
tests/batch_get_item-livestest.go
Index ¶
Constants ¶
const ( ENDPOINT_NAME = "BatchGetItem" BATCHGET_ENDPOINT = aws_const.ENDPOINT_PREFIX + ENDPOINT_NAME // actual limit is 1024kb QUERY_LIM_BYTES = 1048576 QUERY_LIM = 100 RECURSE_LIM = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchGetItem ¶
type BatchGetItem struct { RequestItems Table2Requests ReturnConsumedCapacity ep.ReturnConsumedCapacity }
func NewBatchGetItem ¶
func NewBatchGetItem() *BatchGetItem
NewBatchGetItem will return a pointer to an initialized BatchGetItem struct.
func Split ¶
func Split(b BatchGetItem) ([]BatchGetItem, error)
Split supports the ability to have BatchGetItem structs whose size excceds the stated AWS limits. This function splits an arbitrarily-sized BatchGetItems into a list of BatchGetItem structs that are limited to the upper bound stated by AWS.
func (BatchGetItem) DoBatchGet ¶
func (b BatchGetItem) DoBatchGet() (string, int, error)
DoBatchGet is an endpoint request handler for BatchGetItem that supports arbitrarily-sized BatchGetItem struct instances. These are split in a list of conforming BatchGetItem instances via `Split` and the concurrently dispatched to DynamoDB, with the resulting responses stitched together. May break your provisioning.
func (BatchGetItem) EndpointReq ¶
func (b BatchGetItem) EndpointReq() (string, int, error)
EndpointReq for BatchGetItem which assumes its BatchGetItem struct instance `b` conforms to AWS limits. Use this if you do not employ arbitrarily-sized BatchGetItems and instead choose to conform to the AWS limits.
func (BatchGetItem) RetryBatchGet ¶
func (b BatchGetItem) RetryBatchGet(depth int) (string, int, error)
RetryBatchGet will attempt to fully complete a conforming BatchGetItem request. Callers for this method should be of len QUERY_LIM or less (see DoBatchGets()). This is different than EndpointReq in that it will extract UnprocessedKeys and form new BatchGetItem's based on those, and combine any results.
type Request ¶
type Request BatchGetItem
type RequestInstance ¶
type RequestInstance struct { AttributesToGet ep.AttributesToGet ConsistentRead bool Keys []ep.Item }
RequestInstance indicates what Keys to retrieve for a Table.
func NewRequestInstance ¶
func NewRequestInstance() *RequestInstance
NewRequestInstance will return a pointer to an initialized RequestInstance struct.
type Response ¶
type Response struct { ConsumedCapacity []ep.ConsumedCapacity Responses map[string][]ep.Item UnprocessedKeys Table2Requests }
func NewResponse ¶
func NewResponse() *Response
NewResponse will return a pointer to an initialized Response struct.
type Table2Requests ¶
type Table2Requests map[string]*RequestInstance
Table2Requests maps Table names to Key and Attribute data to retrieve.