Versions in this module Expand all Collapse all v0 v0.2.1 Jul 20, 2016 v0.2.0 Apr 15, 2016 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 ETCD + 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 + TLS *tls.Config + Username string + type KVPair struct + Key string + LastIndex uint64 + Value []byte + type LockOptions struct + RenewLock chan struct{} + TTL time.Duration + Value []byte + type Locker interface + Lock func(stopChan chan struct{}) (<-chan struct{}, error) + Unlock func() error + 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) (bool, error) + Get func(key string) (*KVPair, error) + List func(directory string) ([]*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{}) (<-chan *KVPair, error) + WatchTree func(directory string, stopCh <-chan struct{}) (<-chan []*KVPair, error) + type WriteOptions struct + IsDir bool + TTL time.Duration