From 64411c1a52acc7235817d3eb8c152668e3dedf0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Michon?= Date: Wed, 20 Feb 2019 16:19:42 +0100 Subject: [PATCH] Add the reset sentinel command --- sentinel.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sentinel.go b/sentinel.go index 3027bb0e..7cbb90bd 100644 --- a/sentinel.go +++ b/sentinel.go @@ -172,6 +172,16 @@ func (c *SentinelClient) Failover(name string) *StatusCmd { 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 { sentinelAddrs []string