[VOL-5359] Add redis option as KVStore
Change-Id: I432a3deaa83b39bd4796d3ad1637c398e76474bd
Signed-off-by: Abhay Kumar <abhayk@radisys.com>
diff --git a/rw_core/core/kv.go b/rw_core/core/kv.go
index 2a933f2..2df1187 100644
--- a/rw_core/core/kv.go
+++ b/rw_core/core/kv.go
@@ -31,8 +31,13 @@
func newKVClient(ctx context.Context, storeType string, address string, timeout time.Duration) (kvstore.Client, error) {
logger.Infow(ctx, "kv-store-type", log.Fields{"store": storeType})
- if storeType == "etcd" {
+ switch storeType {
+ case "etcd":
return kvstore.NewEtcdClient(ctx, address, timeout, log.FatalLevel)
+ case "redis":
+ return kvstore.NewRedisClient(address, timeout, false)
+ case "redis-sentinel":
+ return kvstore.NewRedisClient(address, timeout, true)
}
return nil, errors.New("unsupported-kv-store")
}