1
0
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:
Dimitrij Denissenko
2015-01-24 12:12:48 +00:00
committed by Vladimir Mihailenco
parent 78cf6f5eae
commit c21e5f3255
19 changed files with 1262 additions and 325 deletions

View File

@ -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},
}
}