Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProbeNotFound = errors.New("probe not found")
ErrProbeNotFound is emitted when a check is performed on a probe that was not added to the prober
Functions ¶
Types ¶
type ProbeResult ¶
type ProbeResult struct { Name string `json:"name"` Healthy bool `json:"healthy"` Comment string `json:"comment"` Error error `json:"error"` Duration time.Duration `json:"duration"` }
ProbeResult is the data structure used to retain the data fetched from a single probe
type Prober ¶
type Prober struct {
// contains filtered or unexported fields
}
Prober entrypoint of the philae api. It will retain a set of probe and run checks when asked to
func NewProber ¶
func NewProber(opts ...ProberOption) *Prober
NewProber is the default constructor of a Prober
func (*Prober) Check ¶
Check will run the check of each probes added and return the result in a Result struct
func (*Prober) CheckOneProbe ¶
func (p *Prober) CheckOneProbe(ctx context.Context, probeName string) *ProbeResult
type ProberError ¶
type ProberError struct {
// contains filtered or unexported fields
}
func (*ProberError) AddError ¶
func (e *ProberError) AddError(name string, err error)
func (*ProberError) Error ¶
func (e *ProberError) Error() string
func (*ProberError) IsEmpty ¶
func (e *ProberError) IsEmpty() bool
type ProberOption ¶
type ProberOption func(p *Prober)
ProberOption is a function modifying some parameters of the Prober
func WithTimeout ¶
func WithTimeout(d time.Duration) ProberOption
WithTimeout is a ProberOption which defines a timeout the prober have to get executed into Recommandation: it should be higher than the timeout of the probes included in it, otherwise it would mask the real errors.
type Result ¶
type Result struct { Healthy bool `json:"healthy"` Probes []*ProbeResult `json:"probes"` Error error `json:"error"` }
Result is the data structure used to retain the data fetched from a single run of each probes