Documentation
¶
Index ¶
Constants ¶
View Source
const Type = "exec"
Type should match the package name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// Name is the name of the endpoint.
Name string `json:"name"`
// Command is the main program entrypoint.
Command string `json:"command"`
// Arguments are individual program parameters.
Arguments []string `json:"arguments,omitempty"`
// ThresholdRTT is the maximum round trip time to
// allow for a healthy endpoint. If non-zero and a
// request takes longer than ThresholdRTT, the
// endpoint will be considered unhealthy. Note that
// this duration includes any in-between network
// latency.
ThresholdRTT time.Duration `json:"threshold_rtt,omitempty"`
// MustContain is a string that the response body
// must contain in order to be considered up.
// NOTE: If set, the entire response body will
// be consumed, which has the potential of using
// lots of memory and slowing down checks if the
// response body is large.
MustContain string `json:"must_contain,omitempty"`
// MustNotContain is a string that the response
// body must NOT contain in order to be considered
// up. If both MustContain and MustNotContain are
// set, they are and-ed together. NOTE: If set,
// the entire response body will be consumed, which
// has the potential of using lots of memory and
// slowing down checks if the response body is large.
MustNotContain string `json:"must_not_contain,omitempty"`
// Raise is a string that tells us if we should throw
// a hard error ("error" - the default), or if we should
// just mark something as degraded ("warn" or "warning").
Raise string `json:"raise,omitempty"`
// Attempts is how many requests the client will
// make to the endpoint in a single check.
Attempts int `json:"attempts,omitempty"`
// AttemptSpacing spaces out each attempt in a check
// by this duration to avoid hitting a remote too
// quickly in succession. By default, no waiting
// occurs between attempts.
AttemptSpacing time.Duration `json:"attempt_spacing,omitempty"`
}
Checker implements a Checker by running programs with os.Exec.
func New ¶
func New(config json.RawMessage) (Checker, error)
New creates a new Checker instance based on json config
Click to show internal directories.
Click to hide internal directories.