File tree Expand file tree Collapse file tree 5 files changed +17
-0
lines changed
Expand file tree Collapse file tree 5 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -5153,6 +5153,11 @@ const docTemplate = `{
51535153 "type": "string",
51545154 "example": "https://example.com/api/docs/index.html"
51555155 },
5156+ "healthz": {
5157+ "description": "Healthz endpoint",
5158+ "type": "string",
5159+ "example": "https://example.com/api/healtzh"
5160+ },
51565161 "v1": {
51575162 "description": "List endpoint for all v1 endpoints",
51585163 "type": "string",
Original file line number Diff line number Diff line change 51425142 "type" : " string" ,
51435143 "example" : " https://example.com/api/docs/index.html"
51445144 },
5145+ "healthz" : {
5146+ "description" : " Healthz endpoint" ,
5147+ "type" : " string" ,
5148+ "example" : " https://example.com/api/healtzh"
5149+ },
51455150 "v1" : {
51465151 "description" : " List endpoint for all v1 endpoints" ,
51475152 "type" : " string" ,
Original file line number Diff line number Diff line change @@ -1138,6 +1138,10 @@ definitions:
11381138 description : Swagger API documentation
11391139 example : https://example.com/api/docs/index.html
11401140 type : string
1141+ healthz :
1142+ description : Healthz endpoint
1143+ example : https://example.com/api/healtzh
1144+ type : string
11411145 v1 :
11421146 description : List endpoint for all v1 endpoints
11431147 example : https://example.com/api/v1
Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ type RootResponse struct {
146146
147147type RootLinks struct {
148148 Docs string `json:"docs" example:"https://example.com/api/docs/index.html"` // Swagger API documentation
149+ Healthz string `json:"healthz" example:"https://example.com/api/healtzh"` // Healthz endpoint
149150 Version string `json:"version" example:"https://example.com/api/version"` // Endpoint returning the version of the backend
150151 V1 string `json:"v1" example:"https://example.com/api/v1"` // List endpoint for all v1 endpoints
151152 V2 string `json:"v2" example:"https://example.com/api/v2"` // List endpoint for all v2 endpoints
@@ -162,6 +163,7 @@ func GetRoot(c *gin.Context) {
162163 c .JSON (http .StatusOK , RootResponse {
163164 Links : RootLinks {
164165 Docs : c .GetString (string (database .ContextURL )) + "/docs/index.html" ,
166+ Healthz : c .GetString (string (database .ContextURL )) + "/healthz" ,
165167 Version : c .GetString (string (database .ContextURL )) + "/version" ,
166168 V1 : c .GetString (string (database .ContextURL )) + "/v1" ,
167169 V2 : c .GetString (string (database .ContextURL )) + "/v2" ,
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ func TestGetRoot(t *testing.T) {
8888 l := router.RootResponse {
8989 Links : router.RootLinks {
9090 Docs : "/docs/index.html" ,
91+ Healthz : "/healthz" ,
9192 Version : "/version" ,
9293 V1 : "/v1" ,
9394 V2 : "/v2" ,
You can’t perform that action at this time.
0 commit comments