Skip to content

Commit 89d0837

Browse files
committed
Tidying up.
1 parent 8a7db21 commit 89d0837

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

siok.go

+8-14
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,11 @@ func parseChecks(checks []Check) string {
104104

105105
func getServiceHealth(c *gin.Context) {
106106

107-
var service Service
108-
var warn Warn
109-
c.BindQuery(&service)
110-
c.BindQuery(&warn)
111-
warnEnabled := parseBoolValue(warn.warn)
107+
var queryString QueryString
108+
c.BindQuery(&queryString)
109+
warnEnabled := parseBoolValue(queryString.Warn)
112110

113-
checks := getChecks(service.ID)
111+
checks := getChecks(queryString.ServiceID)
114112

115113
aggregatedStatus := parseChecks(checks)
116114

@@ -154,14 +152,10 @@ func main() {
154152
}
155153
}
156154

157-
// Service defines the data parsed from URL's querystring
158-
type Service struct {
159-
ID string `form:"service"`
160-
}
161-
162-
// Warn defines the data parsed from URL's querystring
163-
type Warn struct {
164-
warn string `form:"warn"`
155+
// QueryString defines the data parsed from URL's querystring
156+
type QueryString struct {
157+
ServiceID string `form:"service"`
158+
Warn string `form:"warn"`
165159
}
166160

167161
// Check defines the check data to be returned via the API's JSON response

0 commit comments

Comments
 (0)