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)
| 32 | // schema: |
| 33 | // $ref: "#/definitions/Health" |
| 34 | func (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 | } |