mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-25 01:13:40 +01:00
rename GetJSONEncodedServiceStatuses -> GetServiceStatusesAsJSON
This commit is contained in:
parent
dbd95b1bbd
commit
5eb289c4d3
@ -79,7 +79,7 @@ func serviceStatusesHandler(writer http.ResponseWriter, r *http.Request) {
|
|||||||
var err error
|
var err error
|
||||||
buffer := &bytes.Buffer{}
|
buffer := &bytes.Buffer{}
|
||||||
gzipWriter := gzip.NewWriter(buffer)
|
gzipWriter := gzip.NewWriter(buffer)
|
||||||
data, err = watchdog.GetJSONEncodedServiceStatuses()
|
data, err = watchdog.GetServiceStatusesAsJSON()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[main][serviceStatusesHandler] Unable to marshal object to JSON: %s", err.Error())
|
log.Printf("[main][serviceStatusesHandler] Unable to marshal object to JSON: %s", err.Error())
|
||||||
writer.WriteHeader(http.StatusInternalServerError)
|
writer.WriteHeader(http.StatusInternalServerError)
|
||||||
|
@ -21,8 +21,8 @@ var (
|
|||||||
monitoringMutex sync.Mutex
|
monitoringMutex sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetJSONEncodedServiceStatuses returns a list of core.ServiceStatus for each services encoded using json.Marshal.
|
// GetServiceStatusesAsJSON returns a list of core.ServiceStatus for each services encoded using json.Marshal.
|
||||||
func GetJSONEncodedServiceStatuses() ([]byte, error) {
|
func GetServiceStatusesAsJSON() ([]byte, error) {
|
||||||
serviceStatuses := store.GetAll()
|
serviceStatuses := store.GetAll()
|
||||||
data, err := json.Marshal(serviceStatuses)
|
data, err := json.Marshal(serviceStatuses)
|
||||||
return data, err
|
return data, err
|
||||||
|
Loading…
Reference in New Issue
Block a user