Merge pull request #976 from EtienneM/fix/sentinel_reset

Add the reset sentinel command
This commit is contained in:
Vladimir Mihailenco 2019-02-21 10:29:04 +02:00 committed by GitHub
commit bd542089bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -172,6 +172,16 @@ func (c *SentinelClient) Failover(name string) *StatusCmd {
return cmd return cmd
} }
// Reset resets all the masters with matching name. The pattern argument is a
// glob-style pattern. The reset process clears any previous state in a master
// (including a failover in progress), and removes every slave and sentinel
// already discovered and associated with the master.
func (c *SentinelClient) Reset(pattern string) *IntCmd {
cmd := NewIntCmd("sentinel", "reset", pattern)
c.Process(cmd)
return cmd
}
type sentinelFailover struct { type sentinelFailover struct {
sentinelAddrs []string sentinelAddrs []string