Versions in this module Expand all Collapse all v0 v0.2.0 Jul 8, 2021 v0.1.0 Apr 27, 2020 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 + 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(stopChan chan struct{}) (<-chan struct{}, error) + Unlock func() error + type ReadOptions struct + Consistent bool + type Store interface + AtomicDelete func(key string, previous *KVPair) (bool, error) + AtomicPut func(key string, value []byte, previous *KVPair, options *WriteOptions) (bool, *KVPair, error) + Close func() + Delete func(key string) error + DeleteTree func(directory string) error + Exists func(key string, options *ReadOptions) (bool, error) + Get func(key string, options *ReadOptions) (*KVPair, error) + List func(directory string, options *ReadOptions) ([]*KVPair, error) + NewLock func(key string, options *LockOptions) (Locker, error) + Put func(key string, value []byte, options *WriteOptions) error + Watch func(key string, stopCh <-chan struct{}, options *ReadOptions) (<-chan *KVPair, error) + WatchTree func(directory string, stopCh <-chan struct{}, options *ReadOptions) (<-chan []*KVPair, error) + type WriteOptions struct + IsDir bool + KeepAlive bool + TTL time.Duration