22 lines
441 B
Go
22 lines
441 B
Go
package redis
|
|
|
|
import (
|
|
"qoobing.com/gomod/redis/redis"
|
|
"qoobing.com/gomod/redis/sentinel"
|
|
)
|
|
|
|
type Config = sentinel.Config
|
|
|
|
var NewPool = redis.NewPool
|
|
var NewRedisPool = redis.NewPool
|
|
var NewSentinelPool = sentinel.NewPool
|
|
|
|
func NewPool(cfg Config) *redis.Pool {
|
|
if cfg.Master != "" {
|
|
return NewRedisPool(cfg)
|
|
} else if cfg.MasterName {
|
|
return NewSentinelPool(cfg)
|
|
}
|
|
panic("invalid config: Master & MasterName are both empty")
|
|
}
|