dynamodb

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEY_TAG = "key"
)

Variables

View Source
var (
	ErrUnsupported     = errors.New("unsupported")
	ErrUnexpectedInput = errors.New("unexpected input")
	ErrNothingToCommit = errors.New("nothing to commit")
	ErrKeyTagNotFound  = errors.New("key tag not found")
)
View Source
var (
	DefaultTimeout = 10 * time.Second
)

Functions

func IsExistingTable

func IsExistingTable(err error) (bool, error)

Types

type BatchWriter

type BatchWriter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*BatchWriter) Contents

func (b *BatchWriter) Contents() interface{}

func (*BatchWriter) DeleteStruct

func (b *BatchWriter) DeleteStruct(in interface{}) (err error)

func (*BatchWriter) InsertStruct

func (b *BatchWriter) InsertStruct(in interface{}) (err error)

func (*BatchWriter) Len

func (b *BatchWriter) Len() int

func (*BatchWriter) Put

func (b *BatchWriter) Put(ctx context.Context, in interface{}) (err error)

func (*BatchWriter) UpdateStruct

func (b *BatchWriter) UpdateStruct(in interface{}) (err error)

type DynamoDB

type DynamoDB struct {
	// contains filtered or unexported fields
}

func NewDynamoDB

func NewDynamoDB(ctx context.Context, confOpts []func(*config.LoadOptions) error, opts ...Option) (d DynamoDB, err error)

func (*DynamoDB) Commit

func (d *DynamoDB) Commit(ctx context.Context, writer *BatchWriter) (out interface{}, err error)

func (*DynamoDB) CreateTable

func (d *DynamoDB) CreateTable(ctx context.Context, arg *dynamodb.CreateTableInput) (out interface{}, err error)

func (*DynamoDB) CreateTableFromStruct

func (d *DynamoDB) CreateTableFromStruct(ctx context.Context, in interface{}) (out interface{}, err error)

func (*DynamoDB) DescribeTable

func (d *DynamoDB) DescribeTable(ctx context.Context, arg *dynamodb.DescribeTableInput) (out interface{}, err error)

func (*DynamoDB) DescribeTableFromStruct

func (d *DynamoDB) DescribeTableFromStruct(ctx context.Context, in interface{}) (out interface{}, err error)

func (*DynamoDB) DropTable

func (d *DynamoDB) DropTable(ctx context.Context, arg *dynamodb.DeleteTableInput) (out interface{}, err error)

func (*DynamoDB) DropTableFromStruct

func (d *DynamoDB) DropTableFromStruct(ctx context.Context, in interface{}) (out interface{}, err error)

func (*DynamoDB) Get

func (d *DynamoDB) Get(ctx context.Context, arg *dynamodb.GetItemInput) (out interface{}, err error)

func (*DynamoDB) GetStruct added in v0.0.2

func (d *DynamoDB) GetStruct(ctx context.Context, in interface{}, result interface{}) (err error)

func (*DynamoDB) List

func (d *DynamoDB) List(ctx context.Context, arg *dynamodb.ScanInput) (out interface{}, err error)

func (*DynamoDB) ListStruct added in v0.0.2

func (d *DynamoDB) ListStruct(ctx context.Context, in interface{}, result interface{}) (err error)

func (*DynamoDB) WaitForTableCreation

func (d *DynamoDB) WaitForTableCreation(ctx context.Context, in interface{}) error

func (*DynamoDB) WaitForTableDeletion

func (d *DynamoDB) WaitForTableDeletion(ctx context.Context, in interface{}) error

func (*DynamoDB) Writer

func (d *DynamoDB) Writer(ctx context.Context) (out BatchWriter, err error)

type Handler

type Handler func(ctx context.Context, in interface{}) (out interface{}, err error)

type Logger

type Logger zerolog.Logger

func WithLogger

func WithLogger(logger zerolog.Logger) Logger

func (Logger) Apply

func (o Logger) Apply(d *DynamoDB) error

type Middleware

type Middleware func(next Handler) Handler

type Option

type Option interface {
	Apply(*DynamoDB) error
}

type Timeout

type Timeout time.Duration

func WithTimeout

func WithTimeout(timeout time.Duration) Timeout

func (Timeout) Apply

func (o Timeout) Apply(d *DynamoDB) error

Jump to

Keyboard shortcuts

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