Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateItem(ctx context.Context, in interface{}) (*dynamodb.PutItemOutput, error)
- func (c *Client) DeleteItem(ctx context.Context, key interface{}) error
- func (c *Client) Find(ctx context.Context, out interface{}, query string, args ...interface{}) error
- func (c *Client) UpdateItem(ctx context.Context, key interface{}, updates map[string]interface{}) error
- type DynamoDBClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrQuery = errors.New("error querying DynamoDB") ErrGetItem = errors.New("error getting item from DynamoDB") ErrNoArguments = errors.New("no arguments provided for query") ErrNoPlaceholders = errors.New("number of placeholders does not match number of arguments") ErrConditionFormat = errors.New("each condition must be in the format 'attribute = $index'") ErrPlaceholderFormat = errors.New("placeholder must be in the format '$index'") ErrUnsupportedType = errors.New("unsupported argument type") ErrGetItemKeyCondition = errors.New("GetItem requires exactly one key condition") ErrParameterNotPointer = errors.New("out parameter must be a pointer") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an interface for the DynamoDB client.
func NewClient ¶
func NewClient(db DynamoDBClient, tableName *string) *Client
NewClient returns a new DynamoDB client.
func (*Client) CreateItem ¶
CreateItem handles creating a new item in the database.
func (*Client) DeleteItem ¶
DeleteItem deletes an item from the database.
type DynamoDBClient ¶
type DynamoDBClient interface { PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error) Query(ctx context.Context, input *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error) GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error) UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error) DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error) }
DynamoDBClient is an interface for the DynamoDB client.
Click to show internal directories.
Click to hide internal directories.