1
0
mirror of https://github.com/redis/go-redis.git synced 2025-04-19 07:22:17 +03:00

Add the failover sentinel command

This commit is contained in:
Étienne Michon 2019-02-20 11:39:33 +01:00
parent 73ef066b86
commit c341fb219f
No known key found for this signature in database
GPG Key ID: 3D0A46951838A869

View File

@ -164,6 +164,14 @@ func (c *SentinelClient) Sentinels(name string) *SliceCmd {
return cmd
}
// Failover forces a failover as if the master was not reachable, and without
// asking for agreement to other Sentinels.
func (c *SentinelClient) Failover(name string) *StatusCmd {
cmd := NewStatusCmd("sentinel", "failover", name)
c.Process(cmd)
return cmd
}
type sentinelFailover struct {
sentinelAddrs []string