mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Pass network and addr to dialer
This commit is contained in:
@ -25,6 +25,7 @@ type FailoverOptions struct {
|
||||
|
||||
// Following options are copied from Options struct.
|
||||
|
||||
Dialer func(network, addr string) (net.Conn, error)
|
||||
OnConnect func(*Conn) error
|
||||
|
||||
Password string
|
||||
@ -50,8 +51,8 @@ type FailoverOptions struct {
|
||||
|
||||
func (opt *FailoverOptions) options() *Options {
|
||||
return &Options{
|
||||
Addr: "FailoverClient",
|
||||
|
||||
Addr: "FailoverClient",
|
||||
Dialer: opt.Dialer,
|
||||
OnConnect: opt.OnConnect,
|
||||
|
||||
DB: opt.DB,
|
||||
@ -304,7 +305,7 @@ func (c *sentinelFailover) Pool() *pool.ConnPool {
|
||||
return c.pool
|
||||
}
|
||||
|
||||
func (c *sentinelFailover) dial() (net.Conn, error) {
|
||||
func (c *sentinelFailover) dial(network, addr string) (net.Conn, error) {
|
||||
addr, err := c.MasterAddr()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user