Documentation ¶
Overview ¶
Package probe provides liveness / readiness probe.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
GetStatus() error
}
Client is the interface to check the status of a probe controller.
func NewFileClient ¶
NewFileClient creates an instance of Client based on the file status specified in the path. The specified period is the interval of the probe, so if this
type Controller ¶
Controller provides the internal interface to handle events coming from Emitters. Individual controller implementation will update its prober status.
func NewFileController ¶
func NewFileController(opt *Options) Controller
NewFileController creates a new Controller implementation which creates a file at the specified path only when the registered emitters are all available.
type Options ¶
type Options struct { // Path defines the path to the file used for the existence. Path string // UpdateInterval defines the interval for updating the file's last modified // time. UpdateInterval time.Duration }
Options customizes the parameters of a probe.
type Probe ¶
type Probe struct {
// contains filtered or unexported fields
}
Probe manages the availability status used by Controller. Probe also implements SupportsProbe by itself, therefore a struct which embeds this can be registered.
func (*Probe) IsAvailable ¶
IsAvailable returns the current status.
func (*Probe) RegisterProbe ¶
func (p *Probe) RegisterProbe(c Controller, name string)
RegisterProbe implements SupportsProbe interface.
func (*Probe) SetAvailable ¶
SetAvailable sets the new status, and notifies the controller.
type SupportsProbe ¶
type SupportsProbe interface {
RegisterProbe(c Controller, name string)
}
SupportsProbe provides the interface to register itself to a controller.