From b920c88a6ba098715f44f340ca17626d976759dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Wed, 30 Sep 2020 03:59:49 +0200 Subject: [PATCH] Rename host -> hosts in stats/tactical_overview --- go.mod | 1 + lql/v1.go | 2 +- lql/v1stats.go | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a8d47a4..356f0bd 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/loopfz/gadgeto v0.10.1 github.com/sirupsen/logrus v1.7.0 github.com/spf13/cobra v1.0.0 + github.com/stretchr/testify v1.4.0 github.com/toorop/gin-logrus v0.0.0-20200831135515-d2ee50d38dae github.com/wI2L/fizz v0.13.4 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a diff --git a/lql/v1.go b/lql/v1.go index b78d062..fe1c771 100644 --- a/lql/v1.go +++ b/lql/v1.go @@ -12,7 +12,7 @@ func v1Routes(grp *fizz.RouterGroup) { }, tonic.Handler(v1RawPost, 200)) grp.GET("/ping", []fizz.OperationOption{ - fizz.Summary("GET Play ping-ping with the API"), + fizz.Summary("Play ping-ping with the API"), fizz.Response("400", "Bad request", nil, nil), }, tonic.Handler(v1Ping, 200)) diff --git a/lql/v1stats.go b/lql/v1stats.go index 8b3d8b2..7d4e52f 100644 --- a/lql/v1stats.go +++ b/lql/v1stats.go @@ -7,7 +7,7 @@ import ( ) type V1StatsTacticalOverview struct { - Host *V1StatsTacticalOverviewEntry `json:"host" validate:"required" description:"Host stats"` + Hosts *V1StatsTacticalOverviewEntry `json:"hosts" validate:"required" description:"Host stats"` Services *V1StatsTacticalOverviewEntry `json:"services" validate:"required" description:"Service stats"` Events *V1StatsTacticalOverviewEntry `json:"events" validate:"required" description:"Event stats"` } @@ -116,5 +116,5 @@ StatsAnd: 3` ev.Unhandled = rsp[0]["stats_3"].(float64) ev.Stale = 0 - return &V1StatsTacticalOverview{Host: host, Services: svc, Events: ev}, nil + return &V1StatsTacticalOverview{Hosts: host, Services: svc, Events: ev}, nil }