MCPcopy
hub / github.com/gotify/server / Health

Method Health

api/health.go:34–46  ·  view source on GitHub ↗

Health returns health information. swagger:operation GET /health health getHealth Get health information. --- produces: [application/json] responses: 200: description: Ok schema: $ref: "#/definitions/Health" 500: description: Ok schema: $ref: "#/defin

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

32// schema:
33// $ref: "#/definitions/Health"
34func (a *HealthAPI) Health(ctx *gin.Context) {
35 if err := a.DB.Ping(); err != nil {
36 ctx.JSON(500, model.Health{
37 Health: model.StatusOrange,
38 Database: model.StatusRed,
39 })
40 return
41 }
42 ctx.JSON(200, model.Health{
43 Health: model.StatusGreen,
44 Database: model.StatusGreen,
45 })
46}

Callers 2

TestHealthSuccessMethod · 0.80
TestDatabaseFailureMethod · 0.80

Calls 1

PingMethod · 0.65

Tested by 2

TestHealthSuccessMethod · 0.64
TestDatabaseFailureMethod · 0.64