Private EtcdHelper
This commit is contained in:
@@ -33,7 +33,7 @@ type REST struct {
|
||||
}
|
||||
|
||||
// NewStorage returns a RESTStorage object that will work against endpoints.
|
||||
func NewStorage(h tools.EtcdHelper) *REST {
|
||||
func NewStorage(s tools.StorageInterface) *REST {
|
||||
prefix := "/services/endpoints"
|
||||
return &REST{
|
||||
&etcdgeneric.Etcd{
|
||||
@@ -56,7 +56,7 @@ func NewStorage(h tools.EtcdHelper) *REST {
|
||||
CreateStrategy: endpoint.Strategy,
|
||||
UpdateStrategy: endpoint.Strategy,
|
||||
|
||||
Helper: h,
|
||||
Storage: s,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@@ -32,16 +32,16 @@ import (
|
||||
"github.com/coreos/go-etcd/etcd"
|
||||
)
|
||||
|
||||
func newHelper(t *testing.T) (*tools.FakeEtcdClient, tools.EtcdHelper) {
|
||||
func newEtcdStorage(t *testing.T) (*tools.FakeEtcdClient, tools.StorageInterface) {
|
||||
fakeEtcdClient := tools.NewFakeEtcdClient(t)
|
||||
fakeEtcdClient.TestIndex = true
|
||||
helper := tools.NewEtcdHelper(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())
|
||||
return fakeEtcdClient, helper
|
||||
etcdStorage := tools.NewEtcdStorage(fakeEtcdClient, latest.Codec, etcdtest.PathPrefix())
|
||||
return fakeEtcdClient, etcdStorage
|
||||
}
|
||||
|
||||
func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
|
||||
fakeEtcdClient, h := newHelper(t)
|
||||
storage := NewStorage(h)
|
||||
fakeEtcdClient, s := newEtcdStorage(t)
|
||||
storage := NewStorage(s)
|
||||
return storage, fakeEtcdClient
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user