Documentation ¶
Overview ¶
Package health provides a simple web server health monitoring system.
A series of criterions are created. The process is considered to be in good health if all criterions have positive counts. Otherwise, the process is in bad health. The internal implementation uses refcounting.
The health of the process can be queried at /health on the default HTTP serve mux. This returns 200 or 503. /health/info provides more detailed info about bad criterions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Criterion ¶
type Criterion struct {
// contains filtered or unexported fields
}
func NewCriterion ¶
Create a new criterion. If ok is true, the initial counter value is 1; otherwise, it is 0.
func (*Criterion) Add ¶
Add to the criterion counter. If the resulting count is positive, the criterion is in good health.
func (*Criterion) SetStatus ¶
Set the criterion status. This is a freeform string which you may optionally use to describe the current criterion status.
func (*Criterion) Status ¶
Return the current criterion status. The default status is the empty string.