mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-04 12:52:27 +08:00
cache.Redis增加SetConn方法,修改redis包地址
This commit is contained in:
7
cache/redis.go
vendored
7
cache/redis.go
vendored
@@ -4,7 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/garyburd/redigo/redis"
|
"github.com/gomodule/redigo/redis"
|
||||||
)
|
)
|
||||||
|
|
||||||
//Redis redis cache
|
//Redis redis cache
|
||||||
@@ -45,6 +45,11 @@ func NewRedis(opts *RedisOpts) *Redis {
|
|||||||
return &Redis{pool}
|
return &Redis{pool}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//SetConn 设置conn
|
||||||
|
func (r *Redis) SetConn(conn *redis.Pool) {
|
||||||
|
r.conn = conn
|
||||||
|
}
|
||||||
|
|
||||||
//Get 获取一个值
|
//Get 获取一个值
|
||||||
func (r *Redis) Get(key string) interface{} {
|
func (r *Redis) Get(key string) interface{} {
|
||||||
conn := r.conn.Get()
|
conn := r.conn.Get()
|
||||||
|
|||||||
Reference in New Issue
Block a user