Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
tank
Commits
93ab314a
Commit
93ab314a
authored
Mar 21, 2022
by
robwa
Browse files
fix: Fix return type doc for health endpoint
parent
0cb79447
Changes
2
Show whitespace changes
Inline
Side-by-side
api/docs/docs.go
View file @
93ab314a
...
...
@@ -1525,13 +1525,13 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/main.Health"
"$ref": "#/definitions/main.Health
2
"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/main.Health"
"$ref": "#/definitions/main.Health
2
"
}
}
}
...
...
@@ -1691,23 +1691,20 @@ const docTemplate = `{
}
}
},
"main.Health": {
"main.Health
2
": {
"type": "object",
"properties": {
"auth": {
"
$ref": "#/definitions/main.HealthStatus
"
"
type": "string
"
},
"importer": {
"
$ref": "#/definitions/main.HealthStatus
"
"
type": "string
"
},
"store": {
"
$ref": "#/definitions/main.HealthStatus
"
"
type": "string
"
}
}
},
"main.HealthStatus": {
"type": "object"
},
"store.File": {
"type": "object",
"properties": {
...
...
cmd/tank/web.go
View file @
93ab314a
...
...
@@ -114,12 +114,19 @@ type Health struct {
Importer
HealthStatus
`json:"importer"`
}
// HealthDoc is used in doc and prevents errors when checking response schema conformance with schemathesis
type
HealthDoc
struct
{
Auth
string
`json:"auth"`
Store
string
`json:"store"`
Importer
string
`json:"importer"`
}
// healthzHandler checks daemon health.
// @Summary Check health
// @Description Checks daemon health.
// @Produce json
// @Success 200 {object} Health
// @Failure 503 {object} Health
// @Success 200 {object} Health
Doc
// @Failure 503 {object} Health
Doc
// @Router /healthz [get]
func
healthzHandler
(
c
*
gin
.
Context
,
st
*
store
.
Store
,
im
*
importer
.
Importer
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Second
)
// TODO: hardcoded value
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment