redis.go 436 B

1234567891011121314151617181920
  1. package init_serve
  2. import (
  3. "eta_gn/eta_bridge/global"
  4. "eta_gn/eta_bridge/utils"
  5. "fmt"
  6. )
  7. func Redis() {
  8. var conf string
  9. conf = fmt.Sprintf(`{"key":"redis","conn":"%s","password":"%s"}`, global.CONFIG.Redis.Address, global.CONFIG.Redis.Password)
  10. redisClient, err := utils.InitRedis(global.CONFIG.Redis.ServeType, conf)
  11. if err != nil {
  12. fmt.Println("redis链接异常:", err)
  13. panic(any(err))
  14. }
  15. global.Rc = redisClient
  16. }