Documentation ¶
Index ¶
- Constants
- Variables
- func New(endpoints []string, options *store.Config) (store.Store, error)
- func Register()
- type Zmq
- func (s *Zmq) AtomicDelete(key string, previous *store.KVPair) (bool, error)
- func (s *Zmq) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)
- func (s *Zmq) Close()
- func (s *Zmq) Delete(key string) error
- func (s *Zmq) DeleteTree(directory string) error
- func (s *Zmq) Exists(key string) (bool, error)
- func (s *Zmq) Get(key string) (*store.KVPair, error)
- func (s *Zmq) List(directory string) ([]*store.KVPair, error)
- func (s *Zmq) NewLock(key string, options *store.LockOptions) (store.Locker, error)
- func (s *Zmq) Put(key string, value []byte, options *store.WriteOptions) error
- func (s *Zmq) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, error)
- func (s *Zmq) WatchTree(directory string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error)
Constants ¶
View Source
const ( // DefaultWatchWaitTime is how long we block for at a // time to check if the watched key has changed. This // affects the minimum time it takes to cancel a watch. DefaultWatchWaitTime = 15 * time.Second // RenewSessionRetryMax is the number of time we should try // to renew the session before giving up and throwing an error RenewSessionRetryMax = 5 // MaxSessionDestroyAttempts is the maximum times we will try // to explicitely destroy the session attached to a lock after // the connectivity to the store has been lost MaxSessionDestroyAttempts = 5 )
Variables ¶
View Source
var ( // ErrMultipleEndpointsUnsupported is thrown when there are // multiple endpoints specified for Consul ErrMultipleEndpointsUnsupported = errors.New("consul does not support multiple endpoints") // ErrSessionRenew is thrown when the session can't be // renewed because the Consul version does not support sessions ErrSessionRenew = errors.New("cannot set or renew session for ttl, unable to operate on sessions") )
Functions ¶
Types ¶
type Zmq ¶
Consul is the receiver type for the Store interface
func (*Zmq) AtomicDelete ¶
Atomic delete of a single value
func (*Zmq) AtomicPut ¶
func (s *Zmq) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)
Atomic CAS operation on a single value. Pass previous = nil to create a new key.
func (*Zmq) DeleteTree ¶
DeleteTree deletes a range of keys under a given directory
func (*Zmq) Get ¶
Get the value at "key", returns the last modified index to use in conjunction to CAS calls
func (*Zmq) NewLock ¶
NewLock creates a lock for a given key. The returned Locker is not held and must be acquired with `.Lock`. The Value is optional.
Click to show internal directories.
Click to hide internal directories.