Documentation ¶
Index ¶
- Constants
- Variables
- func New(endpoints []string, options *store.Config) (store.Store, error)
- func Register()
- type DynamoDB
- func (ddb *DynamoDB) AtomicDelete(key string, previous *store.KVPair) (bool, error)
- func (ddb *DynamoDB) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)
- func (ddb *DynamoDB) Close()
- func (ddb *DynamoDB) Delete(key string) error
- func (ddb *DynamoDB) DeleteTree(keyPrefix string) error
- func (ddb *DynamoDB) Exists(key string, options *store.ReadOptions) (bool, error)
- func (ddb *DynamoDB) Get(key string, options *store.ReadOptions) (*store.KVPair, error)
- func (ddb *DynamoDB) List(directory string, options *store.ReadOptions) ([]*store.KVPair, error)
- func (ddb *DynamoDB) NewLock(key string, options *store.LockOptions) (store.Locker, error)
- func (ddb *DynamoDB) Put(key string, value []byte, options *store.WriteOptions) error
- func (ddb *DynamoDB) Watch(key string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan *store.KVPair, error)
- func (ddb *DynamoDB) WatchTree(directory string, stopCh <-chan struct{}, opts *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 // 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 ¶
Types ¶
type DynamoDB ¶
type DynamoDB struct {
// contains filtered or unexported fields
}
DynamoDB store used to interact with AWS DynamoDB
func (*DynamoDB) AtomicDelete ¶
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) DeleteTree ¶
DeleteTree deletes a range of keys under a given directory
func (*DynamoDB) NewLock ¶
NewLock has to implemented at the library level since its not supported by DynamoDB
Click to show internal directories.
Click to hide internal directories.