Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
Use fork libkv (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmengin authored and ldez committed Nov 14, 2017
1 parent cfd0a61 commit af517d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
[[constraint]]
branch = "master"
name = "github.com/docker/libkv"
source = "github.com/abronan/libkv"

[[constraint]]
branch = "master"
Expand Down
4 changes: 2 additions & 2 deletions kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ func collateKvRecursive(objValue reflect.Value, kv map[string]string, key string

// ListRecursive lists all key value children under key
func (kv *KvSource) ListRecursive(key string, pairs map[string][]byte) error {
pairsN1, err := kv.List(key)
pairsN1, err := kv.List(key, nil)
if err == store.ErrKeyNotFound {
return nil
}
if err != nil {
return err
}
if len(pairsN1) == 0 {
pairLeaf, err := kv.Get(key)
pairLeaf, err := kv.Get(key, nil)
if err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions kv_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (s *Mock) Put(key string, value []byte, opts *store.WriteOptions) error {
return nil
}

func (s *Mock) Get(key string) (*store.KVPair, error) {
func (s *Mock) Get(key string, options *store.ReadOptions) (*store.KVPair, error) {
if s.Error {
return nil, errors.New("error")
}
Expand All @@ -36,17 +36,17 @@ func (s *Mock) Delete(key string) error {
}

// Exists mock
func (s *Mock) Exists(key string) (bool, error) {
func (s *Mock) Exists(key string, options *store.ReadOptions) (bool, error) {
return false, errors.New("exists not supported")
}

// Watch mock
func (s *Mock) Watch(key string, stopCh <-chan struct{}) (<-chan *store.KVPair, error) {
func (s *Mock) Watch(key string, stopCh <-chan struct{}, options *store.ReadOptions) (<-chan *store.KVPair, error) {
return nil, errors.New("watch not supported")
}

// WatchTree mock
func (s *Mock) WatchTree(prefix string, stopCh <-chan struct{}) (<-chan []*store.KVPair, error) {
func (s *Mock) WatchTree(prefix string, stopCh <-chan struct{}, options *store.ReadOptions) (<-chan []*store.KVPair, error) {
return s.WatchTreeMethod(), nil
}

Expand All @@ -56,7 +56,7 @@ func (s *Mock) NewLock(key string, options *store.LockOptions) (store.Locker, er
}

// List mock
func (s *Mock) List(prefix string) ([]*store.KVPair, error) {
func (s *Mock) List(prefix string, options *store.ReadOptions) ([]*store.KVPair, error) {
if s.Error {
return nil, errors.New("error")
}
Expand Down

0 comments on commit af517d5

Please sign in to comment.