Commit 24152d41 by zhengqiuyun86

初始化

parent 0dde3495
...@@ -63,7 +63,8 @@ var LogShowSql = true ...@@ -63,7 +63,8 @@ var LogShowSql = true
//Redis conf //Redis conf
type RedisConf struct { type RedisConf struct {
RedisAddr string RedisHost string
RedisPort int
RedisPwd string RedisPwd string
RedisDb int RedisDb int
} }
......
...@@ -17,7 +17,7 @@ var redisClient *redis.Client ...@@ -17,7 +17,7 @@ var redisClient *redis.Client
func init() { func init() {
redisClient = redis.NewClient(&redis.Options{ redisClient = redis.NewClient(&redis.Options{
Addr: conf.Redis.RedisAddr, Addr: fmt.Sprintf("%s:%d", conf.Redis.RedisHost, conf.Redis.RedisPort),
Password: conf.Redis.RedisPwd, Password: conf.Redis.RedisPwd,
DB: conf.Redis.RedisDb, // redis一共16个库,指定其中一个库即可 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