From 79eb40ca0752789b473b930a54736466f918bef9 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Mon, 25 Feb 2019 20:03:11 +0100 Subject: [PATCH] maintenance: expose the Status method --- maintenance/maintenance.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintenance/maintenance.go b/maintenance/maintenance.go index afa0c01..a4a6581 100644 --- a/maintenance/maintenance.go +++ b/maintenance/maintenance.go @@ -273,6 +273,11 @@ func (s Service) TextHandler(h http.Handler) http.Handler { }) } +// Status returns whether the maintenance mode is enabled. +func (s Service) Status() (on bool, err error) { + return s.store.Status() +} + // StatusHandler can be used in JSON-encoded HTTP API // to check the status of maintenance. func (s Service) StatusHandler(w http.ResponseWriter, r *http.Request) {