Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMaxFailuresExceeded is returned when the probe is triggered ErrMaxFailuresExceeded = errors.New("max failures exceeded") // ErrNoProbeTypeSpecified if no probe type/kind is specific in the probe // config ErrNoProbeTypeSpecified = errors.New("no probe kind specified in probe.Kind") // ErrProbeTypeNotAvailable is returned if not probe of type is // available to load ErrProbeTypeNotAvailable = errors.New("probe kind not available") )
View Source
var ( // ErrURLNotDefined is returned if the probe config does not // have a url set in the Target field of Config ErrURLNotDefined = errors.New("URL not set in Config.Target") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Target string `yaml:"targer" json:"target"`
}
Config is a general config object for probes
type HTTPProbe ¶
type HTTPProbe struct {
URL string
// contains filtered or unexported fields
}
HTTPProbe is the HTTP probe
func NewHTTPProbe ¶
func NewHTTPProbe() *HTTPProbe
NewHTTPProbe instantiates a HTTP probe with the default configured http client
type Kind ¶
type Kind int
const ( // DefaultMaxFailures is the default limit when to trigger the probe DefaultMaxFailures = 5 // DefaultPollInterval is the default interval at which to run the probe DefaultPollInterval = time.Second * 5 // Http uses simple http checks to fulfil probe behavior HTTP Kind = iota // Listener implements a listener to some type of subscription channel // fulfil a passive probe Listener // Event awaits some trigger/event as a to fulfil a passive probe Event // Readiness will use the ProbeReadiness check in a provider Readiness // Liveness will use the ProbeLiveness check in a provider Liveness )
type Probe ¶
type Probe struct {
Name string `yaml:"name" json:"name"`
Kind Kind `yaml:"kind" json:"kind"`
Interval time.Duration `yaml:"duration" json:"duration"`
MaxFailures int `yaml:"maxFailures" json:"maxFailures"`
Spec Config `yaml:"spec" json:"spec"`
Performer adapter
LastStatus bool `yaml:"lastStatus" json:"lastStatus"`
Checks int
Failures int `yaml:"failures" json:"failures"`
// contains filtered or unexported fields
}
Probe is a mechanism with which to check for some state, track said state, and trigger itself if a state is observed outside a tolerance
Click to show internal directories.
Click to hide internal directories.