diff --git a/pkg/store/mock.go b/pkg/store/mock.go index 1ca1b95be3..f262f03ec0 100644 --- a/pkg/store/mock.go +++ b/pkg/store/mock.go @@ -6,15 +6,17 @@ import "github.com/stretchr/testify/mock" type Mock struct { mock.Mock - endpoints []string - options *Config + // Endpoints passed to InitializeMock + Endpoints []string + // Options passed to InitializeMock + Options *Config } // InitializeMock creates a Mock store. func InitializeMock(endpoints []string, options *Config) (Store, error) { s := &Mock{} - s.endpoints = endpoints - s.options = options + s.Endpoints = endpoints + s.Options = options return s, nil } diff --git a/pkg/store/store.go b/pkg/store/store.go index 442ee548f1..d10ecab503 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -12,8 +12,10 @@ import ( type Backend string const ( + // MOCK backend + MOCK Backend = "mock" // CONSUL backend - CONSUL Backend = "consul" + CONSUL = "consul" // ETCD backend ETCD = "etcd" // ZK backend @@ -114,6 +116,7 @@ type Initialize func(addrs []string, options *Config) (Store, error) var ( // Backend initializers initializers = map[Backend]Initialize{ + MOCK: InitializeMock, CONSUL: InitializeConsul, ETCD: InitializeEtcd, ZK: InitializeZookeeper, diff --git a/pkg/store/zookeeper.go b/pkg/store/zookeeper.go index fa324036ae..b55e7f42f7 100644 --- a/pkg/store/zookeeper.go +++ b/pkg/store/zookeeper.go @@ -9,7 +9,6 @@ import ( ) // Zookeeper embeds the zookeeper client -// and list of watches type Zookeeper struct { timeout time.Duration client *zk.Conn