Versions in this module Expand all Collapse all v0 v0.5.1 Mar 30, 2022 v0.5.0 Mar 30, 2022 Changes in this version + var ErrBackendNotSupported = errors.New("backend storage not supported yet, please choose one of") + var ErrCallNotSupported = errors.New("the current call is not supported with this backend") + var ErrCannotLock = errors.New("error acquiring the lock") + var ErrKeyExists = errors.New("previous K/V pair exists, cannot complete Atomic operation") + var ErrKeyModified = errors.New("unable to complete atomic operation, key modified") + var ErrKeyNotFound = errors.New("key not found in store") + var ErrNotReachable = errors.New("api not reachable") + var ErrPreviousNotSpecified = errors.New("previous K/V pair should be provided for the Atomic operation") + func CreateEndpoints(addrs []string, scheme string) (entries []string) + func GetDirectory(key string) string + func Normalize(key string) string + func SplitKey(key string) (path []string) + type Backend string + const BOLTDB + const CONSUL + const DYNAMODB + const ETCD + const ETCDV3 + const REDIS + const ZK + type ClientTLSConfig struct + CACertFile string + CertFile string + KeyFile string + type Config struct + Bucket string + ClientTLS *ClientTLSConfig + ConnectionTimeout time.Duration + Namespace string + Password string + PersistConnection bool + SyncPeriod time.Duration + TLS *tls.Config + Token string + Username string + type KVPair struct + Key string + LastIndex uint64 + Value []byte + type LockOptions struct + DeleteOnUnlock bool + RenewLock chan struct{} + TTL time.Duration + Value []byte + type Locker interface + Lock func(ctx context.Context, stopChan chan struct{}) (<-chan struct{}, error) + Unlock func(ctx context.Context) error + type ReadOptions struct + Consistent bool + type Store interface + AtomicDelete func(ctx context.Context, key string, previous *KVPair) (bool, error) + AtomicPut func(ctx context.Context, key string, value []byte, previous *KVPair, ...) (bool, *KVPair, error) + Close func() error + Delete func(ctx context.Context, key string) error + DeleteTree func(ctx context.Context, directory string) error + Exists func(ctx context.Context, key string, options *ReadOptions) (bool, error) + Get func(ctx context.Context, key string, options *ReadOptions) (*KVPair, error) + List func(ctx context.Context, directory string, options *ReadOptions) ([]*KVPair, error) + NewLock func(ctx context.Context, key string, options *LockOptions) (Locker, error) + Put func(ctx context.Context, key string, value []byte, options *WriteOptions) error + Watch func(ctx context.Context, key string, stopCh <-chan struct{}, options *ReadOptions) (<-chan *KVPair, error) + WatchTree func(ctx context.Context, directory string, stopCh <-chan struct{}, ...) (<-chan []*KVPair, error) + type WriteOptions struct + IsDir bool + KeepAlive bool + TTL time.Duration