mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
Add Redis Cluster support.
This commit is contained in:
committed by
Vladimir Mihailenco
parent
78cf6f5eae
commit
c21e5f3255
18
sentinel.go
18
sentinel.go
@ -92,17 +92,13 @@ func NewFailoverClient(failoverOpt *FailoverOptions) *Client {
|
||||
|
||||
opt: opt,
|
||||
}
|
||||
return &Client{
|
||||
baseClient: &baseClient{
|
||||
opt: opt,
|
||||
connPool: failover.Pool(),
|
||||
},
|
||||
}
|
||||
return newClient(opt, failover.Pool())
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
type sentinelClient struct {
|
||||
commandable
|
||||
*baseClient
|
||||
}
|
||||
|
||||
@ -113,11 +109,13 @@ func newSentinel(clOpt *Options) *sentinelClient {
|
||||
dialer := func() (net.Conn, error) {
|
||||
return net.DialTimeout("tcp", clOpt.Addr, opt.DialTimeout)
|
||||
}
|
||||
base := &baseClient{
|
||||
opt: opt,
|
||||
connPool: newConnPool(newConnFunc(dialer), opt),
|
||||
}
|
||||
return &sentinelClient{
|
||||
baseClient: &baseClient{
|
||||
opt: opt,
|
||||
connPool: newConnPool(newConnFunc(dialer), opt),
|
||||
},
|
||||
baseClient: base,
|
||||
commandable: commandable{process: base.process},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user