Versions in this module Expand all Collapse all v1 v1.0.0 May 16, 2019 Changes in this version + const ACLTokenKey + const BoltVersion1 + const CAAuthAddress + const CAFileKey + const CertFileKey + const CertKeyFileKey + const ClientCertAuthKey + const ClientPort + const ConsulVersion1 + const DefaultLockTryDuration + const DefaultSeparator + const EtcdBaseVersion + const EtcdVersion3 + const InsecureSkipVerify + const KVCapabilityOrderedUpdates + const MaxCallRecvMsgSize + const MaxCallSendMsgSize + const MemVersion1 + const PasswordKey + const PeerPort + const ReadPermission + const ReadWritePermission + const RetryCountKey + const TransportScheme + const TrustedCAFileKey + const UsernameKey + const WritePermission + const ZookeeperVersion1 + var ControllerNotSupported = &controllerNotSupported + var ErrAuthNotSupported = errors.New("Kvdb authentication not supported") + var ErrEmptyValue = errors.New("Value cannot be empty") + var ErrExist = errors.New("Key already exists") + var ErrIllegal = errors.New("Illegal operation") + var ErrInvalidLock = errors.New("Invalid lock/unlock operation") + var ErrMemberDoesNotExist = errors.New("Kvdb member does not exist") + var ErrModified = errors.New("Key Index mismatch") + var ErrNoCertificate = errors.New("Certificate File Path not provided") + var ErrNoPassword = errors.New("Username provided without any password") + var ErrNotFound = errors.New("Key not found") + var ErrNotSupported = errors.New("implementation not supported") + var ErrSetTTLFailed = errors.New("Unable to set ttl value") + var ErrTTLNotSupported = errors.New("TTL value not supported") + var ErrUnknownPermission = errors.New("Unknown Permission Type") + var ErrUnmarshal = errors.New("Failed to unmarshal value") + var ErrValueMismatch = errors.New("Value mismatch") + var ErrWatchStopped = errors.New("Watch Stopped") + func Register(name string, dsInit DatastoreInit, dsVersion DatastoreVersion) error + func SetInstance(kvdb Kvdb) error + func Version(name string, url string, kvdbOptions map[string]string) (string, error) + type Controller interface + AddMember func(nodeIP, nodePeerPort, nodeName string) (map[string][]string, error) + Defragment func(endpoint string, timeout int) error + GetEndpoints func() []string + ListMembers func() (map[string]*MemberInfo, error) + RemoveMember func(nodeName, nodeIP string) error + SetEndpoints func(endpoints []string) error + UpdateMember func(nodeIP, nodePeerPort, nodeName string) (map[string][]string, error) + type CopySelect func(val interface{}) interface + type DatastoreInit func(domain string, machines []string, options map[string]string, cb FatalErrorCB) (Kvdb, error) + type DatastoreVersion func(url string, kvdbOptions map[string]string) (string, error) + type EnumerateSelect func(val interface{}) bool + type FatalErrorCB func(format string, args ...interface{}) + type KVAction int + const KVCreate + const KVDelete + const KVExpire + const KVGet + const KVSet + const KVUknown + type KVFlags uint64 + const KVCreatedIndex + const KVModifiedIndex + const KVPrevExists + const KVTTL + type KVPair struct + Action KVAction + CreatedIndex uint64 + KVDBIndex uint64 + Key string + Lock interface{} + ModifiedIndex uint64 + TTL int64 + Value []byte + type KVPairs []*KVPair + type Kvdb interface + AddUser func(username string, password string) error + Capabilities func() int + CompareAndDelete func(kvp *KVPair, flags KVFlags) (*KVPair, error) + CompareAndSet func(kvp *KVPair, flags KVFlags, prevValue []byte) (*KVPair, error) + Create func(key string, value interface{}, ttl uint64) (*KVPair, error) + Delete func(key string) (*KVPair, error) + DeleteTree func(prefix string) error + Deserialize func([]byte) (KVPairs, error) + Enumerate func(prefix string) (KVPairs, error) + EnumerateWithSelect func(prefix string, enumerateSelect EnumerateSelect, copySelect CopySelect) ([]interface{}, error) + Get func(key string) (*KVPair, error) + GetLockTimeout func() time.Duration + GetVal func(key string, value interface{}) (*KVPair, error) + GetWithCopy func(key string, copySelect CopySelect) (interface{}, error) + GrantUserAccess func(username string, permType PermissionType, subtree string) error + Keys func(prefix, sep string) ([]string, error) + Lock func(key string) (*KVPair, error) + LockWithID func(key string, lockerID string) (*KVPair, error) + LockWithTimeout func(key string, lockerID string, lockTryDuration time.Duration, ...) (*KVPair, error) + Put func(key string, value interface{}, ttl uint64) (*KVPair, error) + RemoveUser func(username string) error + RevokeUsersAccess func(username string, permType PermissionType, subtree string) error + Serialize func() ([]byte, error) + SetFatalCb func(f FatalErrorCB) + SetLockTimeout func(timeout time.Duration) + SnapPut func(kvp *KVPair) (*KVPair, error) + Snapshot func(prefixes []string, consistent bool) (Kvdb, uint64, error) + String func() string + TxNew func() (Tx, error) + Unlock func(kvp *KVPair) error + Update func(key string, value interface{}, ttl uint64) (*KVPair, error) + WatchKey func(key string, waitIndex uint64, opaque interface{}, watchCB WatchCB) error + WatchTree func(prefix string, waitIndex uint64, opaque interface{}, watchCB WatchCB) error + func Instance() Kvdb + func New(name string, domain string, machines []string, options map[string]string, ...) (Kvdb, error) + type MemberInfo struct + ClientUrls []string + DbSize int64 + ID string + IsHealthy bool + Leader bool + PeerUrls []string + type PermissionType int + type ReplayCb struct + Opaque interface{} + Prefix string + WaitIndex uint64 + WatchCB WatchCB + type Tx interface + Abort func() error + Commit func() error + Get func(key string) (*KVPair, error) + GetVal func(key string, value interface{}) (*KVPair, error) + Prepare func() error + Put func(key string, value interface{}, ttl uint64) (*KVPair, error) + type UpdatesCollector interface + ReplayUpdates func(updateCb []ReplayCb) (uint64, error) + Stop func() + func NewUpdatesCollector(db Kvdb, prefix string, startIndex uint64) (UpdatesCollector, error) + type WatchCB func(prefix string, opaque interface{}, kvp *KVPair, err error) error