From c81953ca736995cd3ceca83405a7ddeea4894e05 Mon Sep 17 00:00:00 2001 From: si3nloong Date: Sat, 11 Sep 2021 11:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20feat:=20change=20`*redis.Client`?= =?UTF-8?q?=20to=20`redis.Cmable`=20interface=20to=20support=20redis=20clu?= =?UTF-8?q?ster=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connection.go | 2 +- redis_wrapper.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connection.go b/connection.go index db3f8db..4a25d2c 100644 --- a/connection.go +++ b/connection.go @@ -67,7 +67,7 @@ func OpenConnection(tag string, network string, address string, db int, errChan } // OpenConnectionWithRedisClient opens and returns a new connection -func OpenConnectionWithRedisClient(tag string, redisClient *redis.Client, errChan chan<- error) (Connection, error) { +func OpenConnectionWithRedisClient(tag string, redisClient redis.Cmdable, errChan chan<- error) (Connection, error) { return OpenConnectionWithRmqRedisClient(tag, RedisWrapper{redisClient}, errChan) } diff --git a/redis_wrapper.go b/redis_wrapper.go index 27a36ab..937a79b 100644 --- a/redis_wrapper.go +++ b/redis_wrapper.go @@ -10,7 +10,7 @@ import ( var unusedContext = context.TODO() type RedisWrapper struct { - rawClient *redis.Client + rawClient redis.Cmdable } func (wrapper RedisWrapper) Set(key string, value string, expiration time.Duration) error {