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
1 changed files with 8 additions and 0 deletions

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