Commit 24152d41 by zhengqiuyun86

初始化

parent 0dde3495
......@@ -63,7 +63,8 @@ var LogShowSql = true
//Redis conf
type RedisConf struct {
RedisAddr string
RedisHost string
RedisPort int
RedisPwd string
RedisDb int
}
......
......@@ -17,7 +17,7 @@ var redisClient *redis.Client
func init() {
redisClient = redis.NewClient(&redis.Options{
Addr: conf.Redis.RedisAddr,
Addr: fmt.Sprintf("%s:%d", conf.Redis.RedisHost, conf.Redis.RedisPort),
Password: conf.Redis.RedisPwd,
DB: conf.Redis.RedisDb, // redis一共16个库,指定其中一个库即可
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment