Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTimeout is returned when a check times out during evaluation ErrTimeout = fmt.Errorf("timed out waiting for check") )
Functions ¶
This section is empty.
Types ¶
type Check ¶
Check is the smallest unit of health in gracefully. Checks should be JSON serializable.
type Error ¶ added in v0.0.6
type Error struct {
// contains filtered or unexported fields
}
Error is an error that is JSON serializable.
func WrapError ¶ added in v0.0.6
WrapError will wrap the supplied err (if present) with a JSON serializable wrapper.
func (*Error) MarshalJSON ¶ added in v0.0.6
MarshalJSON enables JSON serialization of this error.
func (*Error) UnmarshalJSON ¶ added in v0.0.6
UnmarshalJSON enables JSON deserialization of this error.
type Metadata ¶
type Metadata struct { Name string `json:"name"` Runbook string `json:"runbook,omitempty"` Weight uint `json:"weight"` }
Metadata contains information common to every check.
type Periodic ¶
type Periodic struct { Metadata Interval time.Duration `json:"interval,string"` Timeout time.Duration `json:"timeout,string"` Clock clockwork.Clock `json:"-"` RunFunc RunFunc `json:"-"` }
Periodic is a Check implementation that runs a provided function on a set interval and configured timeout. This is a common type of Check.
func (*Periodic) GetMetadata ¶
GetMetadata returns meta information about the check.
type Result ¶
type Result struct { State state.State `json:"state"` CurrentHP float32 `json:"currentHP,omitempty"` Error error `json:"error,omitempty"` Timestamp time.Time `json:"timestamp"` }
Result represents the outcome of a given check. This information is useful to help diagnose issues in the system.
type Stream ¶
Stream is a Check implementation
func (*Stream) GetMetadata ¶
GetMetadata returns meta information about the check.