TWEAK: Rename getHealth to getLiveness.

This enables a future getReady that has different checks.
This commit is contained in:
Tyler Smith 2020-05-07 11:00:25 -07:00
parent fcd13e7d90
commit 14daa76e92
No known key found for this signature in database
GPG Key ID: CA38F1A9BE0EC890
1 changed files with 7 additions and 7 deletions

View File

@ -62,18 +62,18 @@ func (h *Health) RegisterCheck(c Check) error {
})
}
// GetHealthArgs are the arguments for GetHealth
type GetHealthArgs struct{}
// GetLivenessArgs are the arguments for GetLiveness
type GetLivenessArgs struct{}
// GetHealthReply is the response for GetHealth
type GetHealthReply struct {
// GetLivenessReply is the response for GetLiveness
type GetLivenessReply struct {
Checks map[string]health.Result `json:"checks"`
Healthy bool `json:"healthy"`
}
// GetHealth returns a summation of the health of the node
func (service *Health) GetHealth(_ *http.Request, _ *GetHealthArgs, reply *GetHealthReply) error {
service.log.Debug("Health: GetHealth called")
// GetLiveness returns a summation of the health of the node
func (service *Health) GetLiveness(_ *http.Request, _ *GetLivenessArgs, reply *GetLivenessReply) error {
service.log.Debug("Health: GetLiveness called")
reply.Checks, reply.Healthy = service.health.Results()
return nil
}