Documentation ¶
Index ¶
- Variables
- func New(addrs []string, options *store.Config) (store.Store, error)
- type EtcdV3Singe
- func (s *EtcdV3Singe) AtomicDelete(key string, previous *store.KVPair) (bool, error)
- func (s *EtcdV3Singe) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)
- func (s *EtcdV3Singe) Close()
- func (s *EtcdV3Singe) Delete(key string) error
- func (s *EtcdV3Singe) DeleteTree(directory string) error
- func (s *EtcdV3Singe) Exists(key string) (bool, error)
- func (s *EtcdV3Singe) Get(key string) (*store.KVPair, error)
- func (s *EtcdV3Singe) List(directory string) ([]*store.KVPair, error)
- func (s *EtcdV3Singe) NewLock(key string, options *store.LockOptions) (store.Locker, error)
- func (s *EtcdV3Singe) Put(key string, value []byte, options *store.WriteOptions) error
- func (s *EtcdV3Singe) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, error)
- func (s *EtcdV3Singe) WatchTree(directory string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error)
- type RegItem
Constants ¶
This section is empty.
Variables ¶
var EtcdConfigAutoSyncInterval = time.Minute * 5
EtcdConfigAutoSyncInterval give a choice to those etcd cluster could not auto sync such I deploy clusters in docker they will dial tcp: lookup etcd1: Try again, can just set this to zero
Functions ¶
Types ¶
type EtcdV3Singe ¶
type EtcdV3Singe struct { AllowKeyNotFound bool FaultRecovery bool // contains filtered or unexported fields }
EtcdV3 is the receiver type for the Store interface
func (*EtcdV3Singe) AtomicDelete ¶
AtomicDelete cas deletes a single value
func (*EtcdV3Singe) AtomicPut ¶
func (s *EtcdV3Singe) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)
AtomicPut CAS operation on a single value. Pass previous = nil to create a new key.
func (*EtcdV3Singe) Delete ¶
func (s *EtcdV3Singe) Delete(key string) error
Delete the value at the specified key
func (*EtcdV3Singe) DeleteTree ¶
func (s *EtcdV3Singe) DeleteTree(directory string) error
DeleteTree deletes a range of keys under a given directory
func (*EtcdV3Singe) Exists ¶
func (s *EtcdV3Singe) Exists(key string) (bool, error)
Exists verifies if a Key exists in the store
func (*EtcdV3Singe) Get ¶
func (s *EtcdV3Singe) Get(key string) (*store.KVPair, error)
Get a value given its key
func (*EtcdV3Singe) List ¶
func (s *EtcdV3Singe) List(directory string) ([]*store.KVPair, error)
List the content of a given prefix
func (*EtcdV3Singe) NewLock ¶
func (s *EtcdV3Singe) NewLock(key string, options *store.LockOptions) (store.Locker, error)
NewLock creates a lock for a given key. The returned Locker is not held and must be acquired with `.Lock`. The Value is optional.
func (*EtcdV3Singe) Put ¶
func (s *EtcdV3Singe) Put(key string, value []byte, options *store.WriteOptions) error
Put a value at the specified key