From c341fb219f2f427beef3d6652ef40ec8892e81a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Michon?= Date: Wed, 20 Feb 2019 11:39:33 +0100 Subject: [PATCH] Add the failover sentinel command --- sentinel.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sentinel.go b/sentinel.go index 0caccd61..3027bb0e 100644 --- a/sentinel.go +++ b/sentinel.go @@ -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