Documentation ¶
Index ¶
- Variables
- type DB
- type DynamoDB
- func (d *DynamoDB) Delete(ctx context.Context, clientId string, version int64) error
- func (d *DynamoDB) Get(ctx context.Context, clientId string) (*Product, int64, error)
- func (d *DynamoDB) Put(ctx context.Context, product *Product) (int64, error)
- func (d *DynamoDB) Scan(ctx context.Context, f func(*Product, int64)) error
- func (d *DynamoDB) Update(ctx context.Context, product *Product, version int64) (int64, error)
- type DynamoDBLogger
- type DynamoDBOption
- type Product
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrOptimisticLock = errors.New("lock error")
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { Get(ctx context.Context, clientId string) (*Product, int64, error) Scan(ctx context.Context, f func(*Product, int64)) error Put(ctx context.Context, record *Product) (int64, error) Update(ctx context.Context, record *Product, version int64) (int64, error) Delete(ctx context.Context, clientId string, version int64) error }
type DynamoDB ¶
type DynamoDB struct {
// contains filtered or unexported fields
}
func NewDynamoDB ¶
func NewDynamoDB( client dynamodbiface.DynamoDBAPI, tableName string, options ...DynamoDBOption, ) *DynamoDB
type DynamoDBLogger ¶
type DynamoDBOption ¶
type DynamoDBOption func(*DynamoDB)
func SetDynamoDBLogger ¶
func SetDynamoDBLogger(l DynamoDBLogger) DynamoDBOption
Click to show internal directories.
Click to hide internal directories.