瀏覽代碼

libnetwork/internal/kvstore: remove unused Watch() method

The BoltDB store is not Watchable, and the Watch function was never used,
so we can remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 年之前
父節點
當前提交
4d09e60f5b

+ 0 - 5
libnetwork/datastore/mock_store.go

@@ -65,11 +65,6 @@ func (s *MockStore) List(prefix string) ([]*store.KVPair, error) {
 	return nil, ErrNotImplemented
 	return nil, ErrNotImplemented
 }
 }
 
 
-// Watch a single key for modifications
-func (s *MockStore) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, error) {
-	return nil, ErrNotImplemented
-}
-
 // AtomicPut put a value at "key" if the key has not been
 // AtomicPut put a value at "key" if the key has not been
 // modified in the meantime, throws an error if this is the case
 // modified in the meantime, throws an error if this is the case
 func (s *MockStore) AtomicPut(key string, newValue []byte, previous *store.KVPair) (*store.KVPair, error) {
 func (s *MockStore) AtomicPut(key string, newValue []byte, previous *store.KVPair) (*store.KVPair, error) {

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

@@ -369,8 +369,3 @@ func (b *BoltDB) Close() {
 		b.client.Close()
 		b.client.Close()
 	}
 	}
 }
 }
-
-// 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
-}

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

@@ -14,8 +14,6 @@ const BOLTDB Backend = "boltdb"
 var (
 var (
 	// ErrBackendNotSupported is thrown when the backend k/v store is not supported by libkv
 	// ErrBackendNotSupported is thrown when the backend k/v store is not supported by libkv
 	ErrBackendNotSupported = errors.New("Backend storage not supported yet, please choose one of")
 	ErrBackendNotSupported = errors.New("Backend storage not supported yet, please choose one of")
-	// ErrCallNotSupported is thrown when a method is not implemented/supported by the current backend
-	ErrCallNotSupported = errors.New("The current call is not supported with this backend")
 	// ErrKeyModified is thrown during an atomic operation if the index does not match the one in the store
 	// ErrKeyModified is thrown during an atomic operation if the index does not match the one in the store
 	ErrKeyModified = errors.New("Unable to complete atomic operation, key modified")
 	ErrKeyModified = errors.New("Unable to complete atomic operation, key modified")
 	// ErrKeyNotFound is thrown when the key is not found in the store during a Get operation
 	// ErrKeyNotFound is thrown when the key is not found in the store during a Get operation
@@ -50,9 +48,6 @@ type Store interface {
 	// Exists verifies if a Key exists in the store.
 	// Exists verifies if a Key exists in the store.
 	Exists(key string) (bool, error)
 	Exists(key string) (bool, error)
 
 
-	// Watch for changes on a key
-	Watch(key string, stopCh <-chan struct{}) (<-chan *KVPair, error)
-
 	// List the content of a given prefix
 	// List the content of a given prefix
 	List(directory string) ([]*KVPair, error)
 	List(directory string) ([]*KVPair, error)