dynamodb

package
v0.2.1-0...-1a60bff Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultReadCapacityUnits default read capacity used to create table
	DefaultReadCapacityUnits = 2
	// DefaultWriteCapacityUnits default write capacity used to create table
	DefaultWriteCapacityUnits = 2
	// TableCreateTimeoutSeconds the maximum time we wait for the AWS DynamoDB table to be created
	TableCreateTimeoutSeconds = 30
	// DeleteTreeTimeoutSeconds the maximum time we retry a write batch
	DeleteTreeTimeoutSeconds = 30
)

Variables

View Source
var (
	// ErrBucketOptionMissing is returned when bucket config option is missing
	ErrBucketOptionMissing = errors.New("missing dynamodb bucket/table name")
	// ErrMultipleEndpointsUnsupported is returned when more than one endpoint is provided
	ErrMultipleEndpointsUnsupported = errors.New("dynamodb only supports one endpoint")
	// ErrTableCreateTimeout table creation timed out
	ErrTableCreateTimeout = errors.New("dynamodb table creation timed out")
	// ErrDeleteTreeTimeout delete batch timed out
	ErrDeleteTreeTimeout = errors.New("delete batch timed out")
	// ErrLockAcquireCancelled stop called before lock was acquired.
	ErrLockAcquireCancelled = errors.New("stop called before lock was acquired")
)

Functions

func New

func New(endpoints []string, options *store.Config) (store.Store, error)

New opens and creates a new table

func Register

func Register()

Register register a store provider in valkeyrie for AWS DynamoDB

Types

type DynamoDB

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

DynamoDB store used to interact with AWS DynamoDB

func (*DynamoDB) AtomicDelete

func (ddb *DynamoDB) AtomicDelete(key string, previous *store.KVPair) (bool, error)

AtomicDelete delete of a single value

func (*DynamoDB) AtomicPut

func (ddb *DynamoDB) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)

AtomicPut Atomic CAS operation on a single value.

func (*DynamoDB) Close

func (ddb *DynamoDB) Close()

Close nothing to see here

func (*DynamoDB) Delete

func (ddb *DynamoDB) Delete(key string) error

Delete the value at the specified key

func (*DynamoDB) DeleteTree

func (ddb *DynamoDB) DeleteTree(keyPrefix string) error

DeleteTree deletes a range of keys under a given directory

func (*DynamoDB) Exists

func (ddb *DynamoDB) Exists(key string, options *store.ReadOptions) (bool, error)

Exists if a Key exists in the store

func (*DynamoDB) Get

func (ddb *DynamoDB) Get(key string, options *store.ReadOptions) (*store.KVPair, error)

Get a value given its key

func (*DynamoDB) List

func (ddb *DynamoDB) List(directory string, options *store.ReadOptions) ([]*store.KVPair, error)

List the content of a given prefix

func (*DynamoDB) NewLock

func (ddb *DynamoDB) NewLock(key string, options *store.LockOptions) (store.Locker, error)

NewLock has to implemented at the library level since its not supported by DynamoDB

func (*DynamoDB) Put

func (ddb *DynamoDB) Put(key string, value []byte, options *store.WriteOptions) error

Put a value at the specified key

func (*DynamoDB) Watch

func (ddb *DynamoDB) Watch(key string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan *store.KVPair, error)

Watch has to implemented at the library level since its not supported by DynamoDB

func (*DynamoDB) WatchTree

func (ddb *DynamoDB) WatchTree(directory string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan []*store.KVPair, error)

WatchTree has to implemented at the library level since its not supported by DynamoDB

Jump to

Keyboard shortcuts

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