Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit d307e0e

Browse files
committed
add instance health check endpoint
1 parent 557e30f commit d307e0e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

health.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package gapi
2+
3+
type HealthResponse struct {
4+
Code string `json:"code,omitempty"`
5+
Message string `json:"message,omitempty"`
6+
Commit string `json:"commit,omitempty"`
7+
Database string `json:"database,omitempty"`
8+
Version string `json:"version,omitempty"`
9+
}
10+
11+
func (c *Client) Health() (HealthResponse, error) {
12+
health := HealthResponse{}
13+
err := c.request("GET", "/api/health", nil, nil, &health)
14+
if err != nil {
15+
return health, err
16+
}
17+
return health, nil
18+
}

0 commit comments

Comments
 (0)