|
@@ -53,15 +53,6 @@ type Store interface {
|
|
|
// Watch for changes on a key
|
|
|
Watch(key string, stopCh <-chan struct{}) (<-chan *KVPair, error)
|
|
|
|
|
|
- // WatchTree watches for changes on child nodes under
|
|
|
- // a given directory
|
|
|
- WatchTree(directory string, stopCh <-chan struct{}) (<-chan []*KVPair, 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.
|
|
|
- NewLock(key string, options *LockOptions) (Locker, error)
|
|
|
-
|
|
|
// List the content of a given prefix
|
|
|
List(directory string) ([]*KVPair, error)
|
|
|
|
|
@@ -91,17 +82,3 @@ type WriteOptions struct {
|
|
|
IsDir bool
|
|
|
TTL time.Duration
|
|
|
}
|
|
|
-
|
|
|
-// LockOptions contains optional request parameters
|
|
|
-type LockOptions struct {
|
|
|
- Value []byte // Optional, value to associate with the lock
|
|
|
- TTL time.Duration // Optional, expiration ttl associated with the lock
|
|
|
- RenewLock chan struct{} // Optional, chan used to control and stop the session ttl renewal for the lock
|
|
|
-}
|
|
|
-
|
|
|
-// Locker provides locking mechanism on top of the store.
|
|
|
-// Similar to `sync.Lock` except it may return errors.
|
|
|
-type Locker interface {
|
|
|
- Lock(stopChan chan struct{}) (<-chan struct{}, error)
|
|
|
- Unlock() error
|
|
|
-}
|