package redis import ( redigo "github.com/gomodule/redigo/redis" "qoobing.com/gomod/redis/redis" "qoobing.com/gomod/redis/sentinel" ) type ( Conn = redigo.Conn Pool = redigo.Pool Config = sentinel.Config ) var ( NewRedisPool = redis.NewPool NewSentinelPool = sentinel.NewPool Int = redigo.Int Int64 = redigo.Int64 Uint64 = redigo.Uint64 Float64 = redigo.Float64 String = redigo.String Strings = redigo.Strings Bool = redigo.Bool Ints = redigo.Ints Float64s = redigo.Float64s Values = redigo.Values ErrNil = redigo.ErrNil ErrPoolExhausted = redigo.ErrPoolExhausted ) func NewPool(cfg Config) *redigo.Pool { if cfg.Master != "" { return NewRedisPool(cfg) } else if cfg.MasterName != "" { return NewSentinelPool(cfg) } panic("invalid config: Master & MasterName are both empty") }