Documentation
¶
Index ¶
- Variables
- func FromEtcdError(err error) error
- func NewLocker(s *concurrency.Session, pfx string) sync.Locker
- type Config
- type ListPagedContinuation
- type ListPagedResp
- type Mutex
- type Store
- func (s *Store) AtomicDelete(ctx context.Context, key string, revision int64) (*etcdclientv3.TxnResponse, error)
- func (s *Store) AtomicPut(ctx context.Context, key string, value []byte, prevRevision int64, ...) (*etcdclientv3.TxnResponse, error)
- func (s *Store) Client() *etcdclientv3.Client
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) DeletePrefix(ctx context.Context, prefix string) error
- func (s *Store) Get(ctx context.Context, key string, revision int64) (*etcdclientv3.GetResponse, error)
- func (s *Store) List(ctx context.Context, directory, start string, revision int64) (*etcdclientv3.GetResponse, error)
- func (s *Store) ListPaged(ctx context.Context, directory string, revision, limit int64, ...) (*ListPagedResp, error)
- func (s *Store) Put(ctx context.Context, key string, value []byte, options *WriteOptions) (*etcdclientv3.PutResponse, error)
- func (s *Store) Watch(ctx context.Context, prefix string, revision int64) etcdclientv3.WatchChan
- func (s *Store) WatchKey(ctx context.Context, prefix string, revision int64) etcdclientv3.WatchChan
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrKeyNotFound is thrown when the key is not found in the store during a Get operation ErrKeyNotFound = errors.New("key not found") ErrKeyModified = errors.New("unable to complete atomic operation, key modified") )
View Source
var ErrLocked = errors.New("mutex: Locked by another session")
ErrLocked is returned by TryLock when Mutex is already locked by another session.
Functions ¶
func FromEtcdError ¶
Types ¶
type ListPagedContinuation ¶
type ListPagedResp ¶
type ListPagedResp struct { Resp *clientv3.GetResponse HasMore bool Continuation *ListPagedContinuation }
type Mutex ¶ added in v0.4.0
type Mutex struct {
// contains filtered or unexported fields
}
Mutex implements the sync Locker interface with etcd
func (*Mutex) Header ¶ added in v0.4.0
func (m *Mutex) Header() *pb.ResponseHeader
Header is the response header received from etcd on acquiring the lock.
func (*Mutex) Lock ¶ added in v0.4.0
Lock locks the mutex with a cancelable context. If the context is canceled while trying to acquire the lock, the mutex tries to clean its stale lock entry.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AtomicDelete ¶
func (s *Store) AtomicDelete(ctx context.Context, key string, revision int64) (*etcdclientv3.TxnResponse, error)
func (*Store) AtomicPut ¶
func (s *Store) AtomicPut(ctx context.Context, key string, value []byte, prevRevision int64, options *WriteOptions) (*etcdclientv3.TxnResponse, error)
func (*Store) Client ¶
func (s *Store) Client() *etcdclientv3.Client
func (*Store) DeletePrefix ¶ added in v0.1.1
func (*Store) Get ¶
func (s *Store) Get(ctx context.Context, key string, revision int64) (*etcdclientv3.GetResponse, error)
func (*Store) List ¶
func (s *Store) List(ctx context.Context, directory, start string, revision int64) (*etcdclientv3.GetResponse, error)
func (*Store) ListPaged ¶
func (s *Store) ListPaged(ctx context.Context, directory string, revision, limit int64, continuation *ListPagedContinuation) (*ListPagedResp, error)
func (*Store) Put ¶
func (s *Store) Put(ctx context.Context, key string, value []byte, options *WriteOptions) (*etcdclientv3.PutResponse, error)
type WriteOptions ¶
Click to show internal directories.
Click to hide internal directories.