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

Commit 8d9d243

Browse files
authored
Merge pull request #112 from grafana/add-health-check
2 parents 557e30f + a7b07fb commit 8d9d243

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

health.go

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

0 commit comments

Comments
 (0)