21 lines
405 B
Go
21 lines
405 B
Go
package model
|
|
|
|
import (
|
|
"game/common/constant"
|
|
"game/server/lobby/config"
|
|
"github.com/fox/fox/db"
|
|
"github.com/fox/fox/log"
|
|
"github.com/go-redis/redis/v8"
|
|
)
|
|
|
|
var UserRedis *redis.Client
|
|
var err error
|
|
|
|
func InitRedis() {
|
|
UserRedis, err = db.InitRedis(config.Cfg.Redis.Password, config.Cfg.Redis.Host, config.Cfg.Redis.Port, constant.Redis1User)
|
|
if err != nil {
|
|
log.Fatal(err.Error())
|
|
return
|
|
}
|
|
}
|