dynamodb

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *dynamodb.DynamoDB

New returns a configured DynamoDB client.

Types

type API

type API struct {
	Client dynamodbiface.DynamoDBAPI
}

API wraps the DynamoDB API interface.

func (*API) IsEnabled

func (a *API) IsEnabled() bool

IsEnabled returns true if the client is enabled and ready for use.

func (*API) PutItem

func (a *API) PutItem(ctx aws.Context, table string, item map[string]*dynamodb.AttributeValue) (resp *dynamodb.PutItemOutput, err error)

PutItem is a convenience wrapper for putting items into a DynamoDB table.

func (*API) Query

func (a *API) Query(ctx aws.Context, table, partitionKey, sortKey, keyConditionExpression string, limit int64, scanIndexForward bool) (resp *dynamodb.QueryOutput, err error)

Query is a convenience wrapper for querying a DynamoDB table. The paritition and sort keys are always referenced in the key condition expression as ":pk" and ":sk". Refer to the DynamoDB documentation for the Query operation's request syntax and key condition expression patterns:

- https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#API_Query_RequestSyntax

- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.KeyConditionExpressions

func (*API) Setup

func (a *API) Setup()

Setup creates a new DynamoDB client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL