Compare commits
No commits in common. "v1.3.4" and "master" have entirely different histories.
12
redis.go
12
redis.go
@ -1,21 +1,11 @@
|
||||
package redis
|
||||
|
||||
import (
|
||||
redigo "github.com/gomodule/redigo/redis"
|
||||
"qoobing.com/gomod/redis/redis"
|
||||
"qoobing.com/gomod/redis/sentinel"
|
||||
)
|
||||
|
||||
type Config = sentinel.Config
|
||||
|
||||
var NewRedisPool = redis.NewPool
|
||||
var NewPool = redis.NewPool
|
||||
var NewSentinelPool = sentinel.NewPool
|
||||
|
||||
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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user