Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Module exported for intialising the health checker.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct { // The Name must be unique among all checks. Name is a required attribute. Name string // Required // Check is the check function that will be executed to check availability. // This function must return an error if the checked service is considered // not available. Check is a required attribute. Check func(ctx context.Context) error // Required // Timeout will override the global timeout value, if it is smaller than // the global timeout (see WithTimeout). Timeout time.Duration // Optional // MaxTimeInError will set a duration for how long a service must be // in an error state until it is considered down/unavailable. MaxTimeInError time.Duration // Optional // MaxContiguousFails will set a maximum number of contiguous // check fails until the service is considered down/unavailable. MaxContiguousFails uint // Optional // StatusListener allows to set a listener that will be called // whenever the AvailabilityStatus (e.g. from "up" to "down"). StatusListener func(ctx context.Context, name string, state health.CheckState) // Optional RefreshPeriod time.Duration InitialDelay time.Duration }
Check represents a single health check.
type Checks ¶
type Checks struct {
// contains filtered or unexported fields
}
Checks holds a list of Check from a list of health.Check.
func (*Checks) CompileHealthCheckerOption ¶
func (c *Checks) CompileHealthCheckerOption() []health.CheckerOption
CompileHealthCheckerOption takes a list of Check and returns health.CheckerOption.
func (*Checks) RegisterChecks ¶
RegisterChecks registers a list of health.Check.
Click to show internal directories.
Click to hide internal directories.