Documentation ¶
Overview ¶
Package dynamodb contains the DynamoDB store implementation.
Index ¶
- Constants
- Variables
- type Config
- type Store
- func (ddb *Store) AtomicDelete(ctx context.Context, key string, previous *store.KVPair) (bool, error)
- func (ddb *Store) AtomicPut(ctx context.Context, key string, value []byte, previous *store.KVPair, ...) (bool, *store.KVPair, error)
- func (ddb *Store) Close() error
- func (ddb *Store) Delete(ctx context.Context, key string) error
- func (ddb *Store) DeleteTree(ctx context.Context, keyPrefix string) error
- func (ddb *Store) Exists(ctx context.Context, key string, _ *store.ReadOptions) (bool, error)
- func (ddb *Store) Get(ctx context.Context, key string, opts *store.ReadOptions) (*store.KVPair, error)
- func (ddb *Store) List(ctx context.Context, directory string, opts *store.ReadOptions) ([]*store.KVPair, error)
- func (ddb *Store) NewLock(_ context.Context, key string, opts *store.LockOptions) (store.Locker, error)
- func (ddb *Store) Put(ctx context.Context, key string, value []byte, opts *store.WriteOptions) error
- func (ddb *Store) Watch(ctx context.Context, key string, _ *store.ReadOptions) (<-chan *store.KVPair, error)
- func (ddb *Store) WatchTree(_ context.Context, _ string, _ *store.ReadOptions) (<-chan []*store.KVPair, error)
Constants ¶
View Source
const ( // DefaultReadCapacityUnits default read capacity used to create table. DefaultReadCapacityUnits = 2 // DefaultWriteCapacityUnits default write capacity used to create table. DefaultWriteCapacityUnits = 2 // DeleteTreeTimeoutSeconds the maximum time we retry a write batch. DeleteTreeTimeoutSeconds = 30 )
View Source
const StoreName = "dynamodb"
StoreName the name of the store.
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") // 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 ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the store.Store interface.
func (*Store) AtomicDelete ¶
func (ddb *Store) AtomicDelete(ctx context.Context, key string, previous *store.KVPair) (bool, error)
AtomicDelete delete of a single value.
func (*Store) AtomicPut ¶
func (ddb *Store) AtomicPut(ctx context.Context, key string, value []byte, previous *store.KVPair, opts *store.WriteOptions) (bool, *store.KVPair, error)
AtomicPut Atomic CAS operation on a single value.
func (*Store) DeleteTree ¶
DeleteTree deletes a range of keys under a given directory.
func (*Store) Get ¶
func (ddb *Store) Get(ctx context.Context, key string, opts *store.ReadOptions) (*store.KVPair, error)
Get a value given its key.
func (*Store) List ¶
func (ddb *Store) List(ctx context.Context, directory string, opts *store.ReadOptions) ([]*store.KVPair, error)
List the content of a given prefix.
func (*Store) NewLock ¶
func (ddb *Store) NewLock(_ context.Context, key string, opts *store.LockOptions) (store.Locker, error)
NewLock has to implemented at the library level since it's not supported by DynamoDB.
func (*Store) Put ¶
func (ddb *Store) Put(ctx context.Context, key string, value []byte, opts *store.WriteOptions) error
Put a value at the specified key.
Click to show internal directories.
Click to hide internal directories.