From a241ec4c146f2c27b72630cbdfa2fc04dad14dcb Mon Sep 17 00:00:00 2001 From: Xian Zhao Date: Wed, 9 May 2018 15:48:11 +0800 Subject: [PATCH] =?UTF-8?q?cache.Redis=E5=A2=9E=E5=8A=A0SetConn=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E4=BF=AE=E6=94=B9redis=E5=8C=85=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cache/redis.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cache/redis.go b/cache/redis.go index 9d102b0..b4039a5 100644 --- a/cache/redis.go +++ b/cache/redis.go @@ -4,7 +4,7 @@ import ( "encoding/json" "time" - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" ) //Redis redis cache @@ -45,6 +45,11 @@ func NewRedis(opts *RedisOpts) *Redis { return &Redis{pool} } +//SetConn 设置conn +func (r *Redis) SetConn(conn *redis.Pool) { + r.conn = conn +} + //Get 获取一个值 func (r *Redis) Get(key string) interface{} { conn := r.conn.Get()