Documentation
¶
Overview ¶
Package dynamodbstore implements idempotency.Store on Amazon DynamoDB.
The table needs a string partition key named "id". Enable DynamoDB TTL on the "expiration" attribute so expired records are removed. The attribute names match Powertools for AWS Lambda, so an existing Powertools idempotency table can be reused.
Each record also stores the creating invocation's token in "lk_token", so a slow invocation cannot overwrite or delete a record another invocation took over.
The Lambda role needs dynamodb:PutItem, dynamodb:GetItem and dynamodb:DeleteItem on the table.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
PutItem(ctx context.Context, in *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
GetItem(ctx context.Context, in *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
DeleteItem(ctx context.Context, in *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
}
API is the subset of the DynamoDB client the store uses. *dynamodb.Client satisfies it.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an idempotency.Store backed by a DynamoDB table.
func (*Store) Create ¶
Create implements idempotency.Store.
func (*Store) Delete ¶
Delete implements idempotency.Store.
func (*Store) Update ¶
Update implements idempotency.Store.