Documentation
¶
Index ¶
- Constants
- func DurationConfig(policy *Policy) (interval, timeout, startPeriod time.Duration, err error)
- func Enabled(policy *Policy) bool
- type DefaultProbeRunner
- type ExecCheck
- type ExecRunner
- type HTTPCheck
- type Instance
- type Policy
- type ProbeResult
- type ProbeRunner
- type Runtime
- type Status
- type StatusSnapshot
- type TCPCheck
- type Type
Constants ¶
View Source
const ( StateInitializing = "Initializing" StateRunning = "Running" )
Variables ¶
This section is empty.
Functions ¶
func DurationConfig ¶
Types ¶
type DefaultProbeRunner ¶
type DefaultProbeRunner struct {
HTTPClient *http.Client
ExecRunner ExecRunner
}
func (DefaultProbeRunner) Check ¶
func (r DefaultProbeRunner) Check(ctx context.Context, inst Instance, policy *Policy) ProbeResult
type ExecRunner ¶
type Policy ¶
type Policy struct {
Type Type `json:"type,omitempty"`
Interval string `json:"interval,omitempty"`
Timeout string `json:"timeout,omitempty"`
StartPeriod string `json:"start_period,omitempty"`
FailureThreshold int `json:"failure_threshold,omitempty"`
SuccessThreshold int `json:"success_threshold,omitempty"`
HTTP *HTTPCheck `json:"http,omitempty"`
TCP *TCPCheck `json:"tcp,omitempty"`
Exec *ExecCheck `json:"exec,omitempty"`
}
func ClonePolicy ¶
func NormalizePolicy ¶
type ProbeResult ¶
type ProbeRunner ¶
type ProbeRunner interface {
Check(ctx context.Context, inst Instance, policy *Policy) ProbeResult
}
type Runtime ¶
type Runtime struct {
Status Status `json:"status,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
ConsecutiveSuccesses int `json:"consecutive_successes,omitempty"`
ConsecutiveFailures int `json:"consecutive_failures,omitempty"`
LastCheckedAt *time.Time `json:"last_checked_at,omitempty"`
LastSuccessAt *time.Time `json:"last_success_at,omitempty"`
LastFailureAt *time.Time `json:"last_failure_at,omitempty"`
LastError string `json:"last_error,omitempty"`
}
func ApplyProbeResult ¶
func CloneRuntime ¶
Click to show internal directories.
Click to hide internal directories.