[VOL-3860] redis client support in voltha-lib-go

redis client support has been added in this patch. There are two
types client `redis` and `redis-sentinel` to connect a redis instance.
redis-sentinel is required to be able to find the master redis
instance from a redis-sentinel process. See redis-sentinel usage
https://redis.io/topics/sentinel and
https://pkg.go.dev/github.com/go-redis/redis/v8#NewFailoverClient
for more information. If there is no need to have any failover
mechanism then the redis client type is the option to choose.

Change-Id: I997ed92115a9d565df632c6dd8184b9bab77b991
diff --git a/pkg/db/backend.go b/pkg/db/backend.go
index 2e57a27..31f100b 100644
--- a/pkg/db/backend.go
+++ b/pkg/db/backend.go
@@ -75,6 +75,10 @@
 
 func (b *Backend) newClient(ctx context.Context, address string, timeout time.Duration) (kvstore.Client, error) {
 	switch b.StoreType {
+	case "redis":
+		return kvstore.NewRedisClient(address, timeout, false)
+	case "redis-sentinel":
+		return kvstore.NewRedisClient(address, timeout, true)
 	case "etcd":
 		return kvstore.NewEtcdClient(ctx, address, timeout, log.WarnLevel)
 	}
@@ -176,7 +180,7 @@
 
 // List retrieves one or more items that match the specified key
 func (b *Backend) List(ctx context.Context, key string) (map[string]*kvstore.KVPair, error) {
-	span, ctx := log.CreateChildSpan(ctx, "etcd-list")
+	span, ctx := log.CreateChildSpan(ctx, "kvs-list")
 	defer span.Finish()
 
 	formattedPath := b.makePath(ctx, key)
@@ -191,7 +195,7 @@
 
 // Get retrieves an item that matches the specified key
 func (b *Backend) Get(ctx context.Context, key string) (*kvstore.KVPair, error) {
-	span, ctx := log.CreateChildSpan(ctx, "etcd-get")
+	span, ctx := log.CreateChildSpan(ctx, "kvs-get")
 	defer span.Finish()
 
 	formattedPath := b.makePath(ctx, key)
@@ -206,7 +210,7 @@
 
 // Put stores an item value under the specifed key
 func (b *Backend) Put(ctx context.Context, key string, value interface{}) error {
-	span, ctx := log.CreateChildSpan(ctx, "etcd-put")
+	span, ctx := log.CreateChildSpan(ctx, "kvs-put")
 	defer span.Finish()
 
 	formattedPath := b.makePath(ctx, key)
@@ -221,7 +225,7 @@
 
 // Delete removes an item under the specified key
 func (b *Backend) Delete(ctx context.Context, key string) error {
-	span, ctx := log.CreateChildSpan(ctx, "etcd-delete")
+	span, ctx := log.CreateChildSpan(ctx, "kvs-delete")
 	defer span.Finish()
 
 	formattedPath := b.makePath(ctx, key)
@@ -234,9 +238,8 @@
 	return err
 }
 
-// DeleteWithPrefix removes items having prefix key
 func (b *Backend) DeleteWithPrefix(ctx context.Context, prefixKey string) error {
-	span, ctx := log.CreateChildSpan(ctx, "etcd-delete-with-prefix")
+	span, ctx := log.CreateChildSpan(ctx, "kvs-delete-with-prefix")
 	defer span.Finish()
 
 	formattedPath := b.makePath(ctx, prefixKey)
@@ -251,7 +254,7 @@
 
 // CreateWatch starts watching events for the specified key
 func (b *Backend) CreateWatch(ctx context.Context, key string, withPrefix bool) chan *kvstore.Event {
-	span, ctx := log.CreateChildSpan(ctx, "etcd-create-watch")
+	span, ctx := log.CreateChildSpan(ctx, "kvs-create-watch")
 	defer span.Finish()
 
 	formattedPath := b.makePath(ctx, key)
@@ -262,7 +265,7 @@
 
 // DeleteWatch stops watching events for the specified key
 func (b *Backend) DeleteWatch(ctx context.Context, key string, ch chan *kvstore.Event) {
-	span, ctx := log.CreateChildSpan(ctx, "etcd-delete-watch")
+	span, ctx := log.CreateChildSpan(ctx, "kvs-delete-watch")
 	defer span.Finish()
 
 	formattedPath := b.makePath(ctx, key)