redis.go 231 B

1234567891011121314
  1. package db
  2. import (
  3. "github.com/go-redis/redis/v8"
  4. "infish.cn/comm"
  5. )
  6. func NewRedisClient(bus *comm.NatsBus) *redis.Client {
  7. client, err := bus.NewRedisFromConfig("box-redis")
  8. if err != nil {
  9. return nil
  10. }
  11. return client
  12. }