Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( errors.New("cannot discover master from sentinel") // ErrInvalidMasterName is retuned by GetMasterAddr, GetSlavesAddrs if master name (group) is not configured ErrInvalidMasterName = errors.New("invalid master name") )ErrMasterUnavailable =
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Password for protected Redis instances Password string // Addrs is a list of redis sentinel instances addresses Addrs []string // Groups is a list of groups (master names) to discover Groups []string // DialTimeout specifies the timeout for tcp dial DialTimeout time.Duration // ReadTimeout specifies the timeout reading from connection ReadTimeout time.Duration // WriteTimeout specifies the timeout writing to connection WriteTimeout time.Duration // RefreshInterval specifies the interval for redis instances refresh RefreshInterval time.Duration // HeartbeatInterval specifies the interval for pub/sub connection healthchecks HeartbeatInterval time.Duration // HeartbeatTimeout specifies the timeout reading pub/sub connection healthcheck reply HeartbeatTimeout time.Duration // OnError is the errors hook OnError func(err error) }
Config is a sentinel watcher config
type Sentinel ¶
type Sentinel struct {
// contains filtered or unexported fields
}
Sentinel is a sentinel watcher
func (*Sentinel) GetMasterAddr ¶
GetMasterAddr returns redis master address
func (*Sentinel) GetSlavesAddrs ¶
GetSlavesAddrs returns reachable redis slaves addresses
Click to show internal directories.
Click to hide internal directories.