Documentation
¶
Overview ¶
Whether a node is up, ready, and well.
TWO SHAPES HERE COULD NOT CROSS BETWEEN TWO PROCESSES and now do. The checks were a map, and a ZAP field is an offset a map has no order to give; they are a list ordered by check name. And a check's details were an `any`, which has no shape until it holds something — the disk check answers with an object, the BLS check with a string, and a chain's check with whatever it likes — so the details cross as the bytes of their own JSON, which is the one shape they all share. Neither change is visible to a caller: the list marshals to the object it replaced, and the raw bytes are written out exactly as they were produced.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIArgs ¶
type APIArgs struct {
// Tags narrows the answer to checks carrying one of these tags. Empty asks
// for all of them.
Tags []string `json:"tags"`
}
APIArgs is the arguments for Readiness, Health, and Liveness.
func (*APIArgs) MarshalZAP ¶ added in v1.1.13
MarshalZAP writes APIArgs from constant offsets.
func (*APIArgs) UnmarshalZAP ¶ added in v1.1.13
UnmarshalZAP reads APIArgs out of the buffer that arrived.
type APIReply ¶
type APIReply struct {
// Checks is what every check answered, ordered by name.
Checks Checks `json:"checks"`
// Healthy is whether every one of them passed.
Healthy bool `json:"healthy"`
}
APIReply is the response for Readiness, Health, and Liveness.
func (*APIReply) MarshalZAP ¶ added in v1.1.14
MarshalZAP writes APIReply from constant offsets.
func (APIReply) StatusCode ¶ added in v1.1.14
StatusCode is the HTTP status this answer carries: 200 when every check passed, 503 when one did not.
It rides the value rather than being set beside it so the code a probe reads and the `healthy` a person reads are the same fact computed once. A caller that never speaks HTTP is unaffected — the value is identical on every wire.
func (*APIReply) UnmarshalZAP ¶ added in v1.1.14
UnmarshalZAP reads APIReply out of the buffer that arrived.
type Check ¶ added in v1.1.14
type Check struct {
// Name is the check's name, the key it appears under on the JSON wire.
Name string `json:"name"`
// Result is what it answered.
Result Result `json:"result"`
}
Check is one named check and what it answered.
func (*Check) MarshalZAP ¶ added in v1.1.14
MarshalZAP writes Check from constant offsets.
func (*Check) UnmarshalZAP ¶ added in v1.1.14
UnmarshalZAP reads Check out of the buffer that arrived.
type Checks ¶ added in v1.1.14
type Checks []Check
Checks is what every check answered: an object keyed by check name on the JSON wire, a list ordered by that name here.
func (Checks) MarshalJSON ¶ added in v1.1.14
func (*Checks) UnmarshalJSON ¶ added in v1.1.14
type Result ¶
type Result struct {
// Details is whatever the check chose to say, as the JSON it said it in.
// A check answers with an object, a string or a list as it sees fit, so
// there is no struct to name and the bytes are the honest shape.
Details types.Raw `json:"message,omitempty"`
// Error is why the check failed, when it did.
Error *string `json:"error,omitempty"`
// Timestamp is when the check last ran.
Timestamp types.Time `json:"timestamp,omitempty"`
// Duration is how long it took.
Duration time.Duration `json:"duration"`
// ContiguousFailures is how many times running it has failed.
ContiguousFailures int64 `json:"contiguousFailures,omitempty"`
// TimeOfFirstFailure is when the current run of failures began.
TimeOfFirstFailure *types.Time `json:"timeOfFirstFailure,omitempty"`
}
Result describes a health check result.
func (*Result) MarshalZAP ¶ added in v1.1.14
MarshalZAP writes Result from constant offsets.
func (*Result) UnmarshalZAP ¶ added in v1.1.14
UnmarshalZAP reads Result out of the buffer that arrived.