From 5eb289c4d30b2b75b2936d711227c61d39167777 Mon Sep 17 00:00:00 2001 From: Chris Heppell Date: Thu, 31 Dec 2020 20:28:57 +0000 Subject: [PATCH] rename GetJSONEncodedServiceStatuses -> GetServiceStatusesAsJSON --- controller/controller.go | 2 +- watchdog/watchdog.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/controller.go b/controller/controller.go index f12786d8..4ec7c4fc 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -79,7 +79,7 @@ func serviceStatusesHandler(writer http.ResponseWriter, r *http.Request) { var err error buffer := &bytes.Buffer{} gzipWriter := gzip.NewWriter(buffer) - data, err = watchdog.GetJSONEncodedServiceStatuses() + data, err = watchdog.GetServiceStatusesAsJSON() if err != nil { log.Printf("[main][serviceStatusesHandler] Unable to marshal object to JSON: %s", err.Error()) writer.WriteHeader(http.StatusInternalServerError) diff --git a/watchdog/watchdog.go b/watchdog/watchdog.go index 091a71e8..408406b8 100644 --- a/watchdog/watchdog.go +++ b/watchdog/watchdog.go @@ -21,8 +21,8 @@ var ( monitoringMutex sync.Mutex ) -// GetJSONEncodedServiceStatuses returns a list of core.ServiceStatus for each services encoded using json.Marshal. -func GetJSONEncodedServiceStatuses() ([]byte, error) { +// GetServiceStatusesAsJSON returns a list of core.ServiceStatus for each services encoded using json.Marshal. +func GetServiceStatusesAsJSON() ([]byte, error) { serviceStatuses := store.GetAll() data, err := json.Marshal(serviceStatuses) return data, err