Переглянути джерело

Merge pull request #68 from keepeye/patch-1

cache.Redis增加SetConn方法,修改redis包地址
silenceper 7 роки тому
батько
коміт
7239daf438
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      cache/redis.go

+ 6 - 1
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()