diff options
author | Shashank Kumar Shankar <shashank.kumar.shankar@intel.com> | 2018-03-20 16:48:05 -0700 |
---|---|---|
committer | Shashank Kumar Shankar <shashank.kumar.shankar@intel.com> | 2018-03-22 16:42:43 -0700 |
commit | 7dd6e2f9e3725427c628b214cb31bda1dbe95234 (patch) | |
tree | 3d76c2aed17003fb13d7ca734ff63e2ff99d63b6 /src/dkv/api/backendfakes.go | |
parent | 1f99187b2ec49a132bd82b40bc4cd02d79cbd416 (diff) |
Make datastore generic to support Consul/Cassandra
This patch makes the backend datastore to be generic so that the
backend datastore can be either Consul or Cassandra. This way,
MUSIC's core functionality can be used and makes other minor fixes.
Change-Id: Iba4eaa751fe60a293d6f2fd60ad06a8c4be1dd1e
Issue-ID: MUSIC-55
Signed-off-by: Shashank Kumar Shankar <shashank.kumar.shankar@intel.com>
Diffstat (limited to 'src/dkv/api/backendfakes.go')
-rw-r--r-- | src/dkv/api/backendfakes.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dkv/api/backendfakes.go b/src/dkv/api/backendfakes.go index c5ca39a..8c8b8a9 100644 --- a/src/dkv/api/backendfakes.go +++ b/src/dkv/api/backendfakes.go @@ -31,6 +31,14 @@ type FakeConsul struct { ConsulStruct } +func (f *FakeConsul) InitializeDatastoreClient() error { + return nil +} + +func (f *FakeConsul) CheckDatastoreHealth() error { + return nil +} + func (f *FakeConsul) RequestGETS() ([]string, error) { return []string{"key1", "key2"}, nil } @@ -52,6 +60,14 @@ type FakeConsulErr struct { ConsulStruct } +func (f *FakeConsulErr) InitializeDatastoreClient() error { + return errors.New("Internal Server Error") +} + +func (f *FakeConsulErr) CheckDatastoreHealth() error { + return errors.New("Internal Server Error") +} + func (f *FakeConsulErr) RequestGETS() ([]string, error) { return []string{"", ""}, errors.New("Internal Server Error") } |