Documentation ¶
Index ¶
- Variables
- func EnableEmptyCollections() func(o *Options)
- func MarshalMap(in interface{}, enableEmptyCollections bool) (map[string]*dynamodb.AttributeValue, error)
- func UnmarshalAll(r Result, v interface{}) (err error)
- type Deitemizer
- type Dynamo
- type Item
- type Itemizer
- type Logger
- type Option
- type Options
- type Querier
- type Reader
- type Result
- type Scanner
- type Writer
- func Check(eb expression.Builder, o dynamodb.ConditionCheck, key Itemizer) *Writer
- func Delete(eb expression.Builder, o dynamodb.Delete, key Itemizer) *Writer
- func NewWriter(opts ...Option) (w *Writer)
- func Put(eb expression.Builder, o dynamodb.Put, item Itemizer) *Writer
- func Update(eb expression.Builder, o dynamodb.Update, key Itemizer) *Writer
- func (tx *Writer) Check(eb expression.Builder, chk dynamodb.ConditionCheck, key Itemizer) *Writer
- func (tx *Writer) Delete(eb expression.Builder, del dynamodb.Delete, key Itemizer) *Writer
- func (tx *Writer) Put(eb expression.Builder, put dynamodb.Put, item Itemizer) *Writer
- func (tx *Writer) Run(ctx context.Context, ddb Dynamo) (r Result, err error)
- func (tx *Writer) Update(eb expression.Builder, upd dynamodb.Update, key Itemizer) *Writer
Constants ¶
This section is empty.
Variables ¶
var DefaultOptions = []Option{EnableEmptyCollections()}
DefaultOptions will be used when no options are specified
Functions ¶
func EnableEmptyCollections ¶ added in v0.7.1
func EnableEmptyCollections() func(o *Options)
EnableEmptyCollections is an option that enables the EnableEmptyCollections on all marshal calls
func MarshalMap ¶ added in v0.7.0
func MarshalMap(in interface{}, enableEmptyCollections bool) (map[string]*dynamodb.AttributeValue, error)
Copied from aws-sdk-go, because Encoder{} does not have EncodeMap()
func UnmarshalAll ¶ added in v0.6.0
UnmarshalAll will run through all results in 'r' and unmarshal all items into 'v'. It will consume the result in the process and it cannot scanned again afterwards. Each element of v must implement the Itemizer and Deitemizer interface.
Types ¶
type Deitemizer ¶
type Dynamo ¶
type Dynamo interface { PutItemWithContext( aws.Context, *dynamodb.PutItemInput, ...request.Option, ) (*dynamodb.PutItemOutput, error) GetItemWithContext( aws.Context, *dynamodb.GetItemInput, ...request.Option, ) (*dynamodb.GetItemOutput, error) DeleteItemWithContext( aws.Context, *dynamodb.DeleteItemInput, ...request.Option, ) (*dynamodb.DeleteItemOutput, error) UpdateItemWithContext( aws.Context, *dynamodb.UpdateItemInput, ...request.Option, ) (*dynamodb.UpdateItemOutput, error) QueryWithContext( aws.Context, *dynamodb.QueryInput, ...request.Option, ) (*dynamodb.QueryOutput, error) TransactWriteItemsWithContext( aws.Context, *dynamodb.TransactWriteItemsInput, ...request.Option, ) (*dynamodb.TransactWriteItemsOutput, error) TransactGetItemsWithContext( aws.Context, *dynamodb.TransactGetItemsInput, ...request.Option, ) (*dynamodb.TransactGetItemsOutput, error) ScanWithContext( aws.Context, *dynamodb.ScanInput, ...request.Option, ) (*dynamodb.ScanOutput, error) }
Dynamo describes the strict sub-set official DynamoDB interface that this library uses.
func LoggedDynamo ¶ added in v0.6.2
LoggedDynamo returns a dynamo interface that logs every interaction with dynamodb to the provider logger
type Logger ¶ added in v0.6.2
type Logger interface {
Printf(format string, v ...interface{})
}
Logger interface can be implemented to log all interaction with DynamoDB
type Options ¶ added in v0.7.1
type Options struct {
// contains filtered or unexported fields
}
Options holds option values for all options that we support
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
Querier holds a DynamoDB query
func Query ¶
func Query(b expression.Builder, in dynamodb.QueryInput) (q *Querier)
Query sets up a query that can be run to fetch
type Reader ¶ added in v0.6.0
type Reader struct {
// contains filtered or unexported fields
}
Reader represents one or more read to dynamodb
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner holds a DynamoDB query
type Writer ¶ added in v0.6.0
type Writer struct {
// contains filtered or unexported fields
}
Writer represents one or more DynamoDB write operations
func Check ¶
func Check(eb expression.Builder, o dynamodb.ConditionCheck, key Itemizer) *Writer
Check will setup a write with the check
func (*Writer) Check ¶ added in v0.6.0
func (tx *Writer) Check(eb expression.Builder, chk dynamodb.ConditionCheck, key Itemizer) *Writer
Check will add a check operation to the write