Documentation
¶
Overview ¶
Package dynamo implements various design patterns for dynamodb and looks to simplify the aws api for aws-sdk-go-v2
Index ¶
- Constants
- type APIBehavior
- type Client
- func (c *Client) Delete(ctx context.Context, key Keyable) error
- func (c *Client) Item(ctx context.Context, key Keyable) (map[string]types.AttributeValue, error)
- func (c *Client) NewDeleteInput(key map[string]types.AttributeValue, cond ...string) *dynamodb.DeleteItemInput
- func (c *Client) NewGetItemIn(k Keyable) *dynamodb.GetItemInput
- func (c *Client) NewPutInput(item map[string]types.AttributeValue, cond ...string) *dynamodb.PutItemInput
- func (c *Client) Put(ctx context.Context, item map[string]types.AttributeValue) error
- func (c *Client) TableName() string
- func (c *Client) Write(ctx context.Context, row Writable) error
- type FormatterError
- type Key
- type Keyable
- type Table
- type Writable
Constants ¶
View Source
const ( HashKeyName = "pk" SortKeyName = "sk" DomainKeyName = "dk" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIBehavior ¶
type APIBehavior interface {
GetItem(context.Context, *dynamodb.GetItemInput, ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
BatchGetItem(context.Context, *dynamodb.BatchGetItemInput, ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)
BatchWriteItem(context.Context, *dynamodb.BatchWriteItemInput, ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)
DeleteItem(context.Context, *dynamodb.DeleteItemInput, ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
PutItem(context.Context, *dynamodb.PutItemInput, ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
Query(context.Context, *dynamodb.QueryInput, ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
Scan(context.Context, *dynamodb.ScanInput, ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)
TransactGetItems(context.Context, *dynamodb.TransactGetItemsInput, ...func(*dynamodb.Options)) (*dynamodb.TransactGetItemsOutput, error)
TransactWriteItems(context.Context, *dynamodb.TransactWriteItemsInput, ...func(*dynamodb.Options)) (*dynamodb.TransactWriteItemsOutput, error)
UpdateItem(context.Context, *dynamodb.UpdateItemInput, ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
UpdateTimeToLive(context.Context, *dynamodb.UpdateTimeToLiveInput, ...func(*dynamodb.Options)) (*dynamodb.UpdateTimeToLiveOutput, error)
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) NewDeleteInput ¶ added in v0.4.3
func (c *Client) NewDeleteInput(key map[string]types.AttributeValue, cond ...string) *dynamodb.DeleteItemInput
func (*Client) NewGetItemIn ¶
func (c *Client) NewGetItemIn(k Keyable) *dynamodb.GetItemInput
func (*Client) NewPutInput ¶
func (c *Client) NewPutInput(item map[string]types.AttributeValue, cond ...string) *dynamodb.PutItemInput
type FormatterError ¶
type FormatterError interface {
FormatForError() string
}
type Key ¶
type Key struct {
Hash string `dynamodbav:"pk"`
Sort string `dynamodbav:"sk"`
Domain string `dynamodbav:"dk"`
ENames map[string]string
CExpr *string
}
func (*Key) ConditionExpr ¶
func (*Key) ExprAttrNames ¶ added in v0.4.2
func (*Key) FormatForError ¶
type Keyable ¶
type Keyable interface {
Full() map[string]types.AttributeValue
ConditionExpr() *string
ExprAttrNames() map[string]string
FormatterError
}
type Writable ¶
type Writable interface {
ToItem() (map[string]types.AttributeValue, error)
ToDBKey() map[string]types.AttributeValue
ConditionExpr() *string
ExprAttrNames() map[string]string
FormatterError
}
Click to show internal directories.
Click to hide internal directories.