1 Star 0 Fork 11

guoyuzh / phalgo

forked from 喵了个咪 / phalgo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
redis.go 710 Bytes
一键复制 编辑 原始数据 按行查看 历史
package phalgo
// PhalGo-Redis
// Redis操作
// 喵了个咪 <wenzhenxi@vip.qq.com> 2016/5/11
// 依赖情况:
// "github.com/astaxie/beego/cache" 基于beego的redis操作
import (
"github.com/garyburd/redigo/redis"
)
var Redis redis.Conn
// 初始化Redis连接
func NewRedis(redisdb string) {
var err error
Config.SetDefault(redisdb, map[string]interface{}{
"network" : "tcp",
"address" : "127.0.0.1:6379",
"password" : "",
})
Redis, err = redis.Dial(Config.GetString(redisdb + ".network"), Config.GetString(redisdb + ".address"), redis.DialPassword(Config.GetString(redisdb + ".password")), redis.DialDatabase(0))
if err != nil {
print(err)
}
defer Redis.Close()
}
1
https://gitee.com/guoyuzh/phalgo.git
git@gitee.com:guoyuzh/phalgo.git
guoyuzh
phalgo
phalgo
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891