Selaa lähdekoodia

libnetwork/internal/kvstore: remove unused WatchTree and NewLock methods

These were not used, and not implemented by the BoltDB store.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 vuotta sitten
vanhempi
commit
e515bef423

+ 0 - 10
libnetwork/datastore/mock_store.go

@@ -76,16 +76,6 @@ func (s *MockStore) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVP
 	return nil, ErrNotImplemented
 }
 
-// WatchTree triggers a watch on a range of values at "directory"
-func (s *MockStore) WatchTree(prefix string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error) {
-	return nil, ErrNotImplemented
-}
-
-// NewLock exposed
-func (s *MockStore) NewLock(key string, options *store.LockOptions) (store.Locker, error) {
-	return nil, ErrNotImplemented
-}
-
 // AtomicPut put a value at "key" if the key has not been
 // modified in the meantime, throws an error if this is the case
 func (s *MockStore) AtomicPut(key string, newValue []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error) {

+ 0 - 10
libnetwork/internal/kvstore/boltdb/boltdb.go

@@ -456,17 +456,7 @@ func (b *BoltDB) DeleteTree(keyPrefix string) error {
 	return err
 }
 
-// NewLock has to implemented at the library level since its not supported by BoltDB
-func (b *BoltDB) NewLock(key string, options *store.LockOptions) (store.Locker, error) {
-	return nil, store.ErrCallNotSupported
-}
-
 // Watch has to implemented at the library level since its not supported by BoltDB
 func (b *BoltDB) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, error) {
 	return nil, store.ErrCallNotSupported
 }
-
-// WatchTree has to implemented at the library level since its not supported by BoltDB
-func (b *BoltDB) WatchTree(directory string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error) {
-	return nil, store.ErrCallNotSupported
-}

+ 0 - 23
libnetwork/internal/kvstore/kvstore.go

@@ -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
-}