diff --git a/common/redis-manager/factory.go b/common/redis-manager/factory.go index 602b86a5097ee58d31b439e64c6dcee84f78f562..e14d59ca5a7477f92410e3545e5e102b3ed66724 100644 --- a/common/redis-manager/factory.go +++ b/common/redis-manager/factory.go @@ -2,7 +2,7 @@ package redis_manager import ( "fmt" - "github.com/eolinker/goku/common/redis" + "github.com/go-redis/redis" "sort" ) @@ -29,21 +29,7 @@ func Create(config RedisConfig) Redis { config: config, } } - case RedisModeSentinel: - { - option := redis.SentinelRingOptions{ - Addrs: config.GetAddrs(), - Masters: config.GetMasters(), - Password: config.GetPassword(), - DB: config.GetDbIndex(), - PoolSize: _PoolSize, - } - return &redisProxy{ - Cmdable: redis.NewSentinelRing(&option), - config: config, - } - } case RedisModeStand: { diff --git a/common/redis-manager/proxy.go b/common/redis-manager/proxy.go index e1ee4905ba18e8d3f6802c425762e733f84fac98..60c2c28be0a83c4344d97d7de81eb29ccd249f09 100644 --- a/common/redis-manager/proxy.go +++ b/common/redis-manager/proxy.go @@ -1,7 +1,7 @@ package redis_manager import ( - "github.com/eolinker/goku/common/redis" + "github.com/go-redis/redis" ) type redisProxy struct { @@ -27,18 +27,7 @@ func (p *redisProxy) Nodes() []string { }(ch) } - case RedisModeSentinel: - { - conn := p.Cmdable.(*redis.SentinelRing) - go func(ch chan string ) { - conn.ForEachAddr(func(addr string) error { - ch<-addr - return nil - }) - close(ch) - }(ch) - } case RedisModeStand: { @@ -68,12 +57,7 @@ func (p *redisProxy) Foreach(fn func(client *redis.Client) error) error { conn := p.Cmdable.(*redis.ClusterClient) return conn.ForEachMaster(fn) } - case RedisModeSentinel: - { - conn := p.Cmdable.(*redis.SentinelRing) - return conn.ForEachShard(fn) - } case RedisModeStand: { diff --git a/common/redis-manager/redis.go b/common/redis-manager/redis.go index 00efcdba46702f32e89dafc8ec7d1f2732f21267..680e0401b99d551c70eed691918889318d0ce5b6 100644 --- a/common/redis-manager/redis.go +++ b/common/redis-manager/redis.go @@ -1,10 +1,9 @@ package redis_manager -import "github.com/eolinker/goku/common/redis" +import "github.com/go-redis/redis" const ( RedisModeCluster = "cluster" - RedisModeSentinel = "sentinel" RedisModeStand = "stand" )