Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Registry = variant.NewRegistry[checker]()
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
func NewChecker ¶
func NewChecker(c checker) Checker
func (*Checker) UnmarshalYAML ¶
type HealthState ¶
type HealthState int8
const ( Healthy HealthState = 1 Unhealthy HealthState = -1 Unknown HealthState = 0 )
func (HealthState) String ¶
func (s HealthState) String() string
type HttpCheck ¶
type HttpCheck struct { Method string `yaml:"method"` // The HTTP method to use Path string `yaml:"path"` // The path to request FollowRedirects bool `yaml:"follow_redirects"` // Follow redirects Header map[string]string `yaml:"header"` // The headers to send with the request Code int `yaml:"code"` // Expected status code Body string `yaml:"body"` // Expected body }
func (*HttpCheck) UnmarshalInline ¶
type Monitor ¶
type Monitor struct { Healthy MonitorLoop `yaml:"healthy"` // The loop for healthy checks. Unhealthy MonitorLoop `yaml:"unhealthy"` // The loop for unhealthy checks. Timeout util.Duration `yaml:"timeout"` // The timeout for each check. Checks map[string]Checker `yaml:"test"` // The checks to perform. }
type MonitorLoop ¶
type MonitorLoop struct { Interval util.Duration `yaml:"interval"` Threshold int `yaml:"threshold"` }
func (MonitorLoop) Or ¶
func (m MonitorLoop) Or(d time.Duration, t int) MonitorLoop
type ObserverFunc ¶
type ObserverFunc func(healthy bool)
func (ObserverFunc) SetHealthy ¶
func (f ObserverFunc) SetHealthy(healthy bool)
Click to show internal directories.
Click to hide internal directories.