Documentation
¶
Index ¶
Constants ¶
View Source
const ( StartingState = health.HealthStateRepairing HealthyState = health.HealthStateHealthy WarningState = health.HealthStateWarning ErrorState = health.HealthStateError )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶ added in v1.21.0
Component represents an individual readiness check that's owned by the ReadinessReporter.
type ComponentName ¶ added in v1.21.0
type ComponentName string
type HealthComponent ¶
type HealthComponent interface { Healthy() Warning(message string) Error(err error) SetHealth(healthState health.HealthState, message *string, params map[string]interface{}) Status() health.HealthState GetHealthCheck() health.HealthCheckResult }
HealthComponent is an extensible component that represents one part of the whole health picture for a service.
type HealthReporter ¶
type HealthReporter interface { status.HealthCheckSource InitializeHealthComponent(name string) (HealthComponent, error) GetHealthComponent(name string) (HealthComponent, bool) UnregisterHealthComponent(name string) bool }
func NewHealthReporter ¶
func NewHealthReporter() HealthReporter
NewHealthReporter - creates a new HealthReporter; an implementation of status.HealthCheckSource which initializes HealthComponents to report on the health of each individual health.CheckType.
type Reporter ¶ added in v1.21.0
type Reporter interface { status.Source InitializeReadinessComponent(ctx context.Context, name ComponentName) (Component, error) GetReadinessComponent(name ComponentName) (Component, bool) UnregisterReadinessComponent(ctx context.Context, name ComponentName) bool }
Reporter allows for the creation and aggregation of custom readiness checks.
func NewReadinessReporter ¶ added in v1.21.0
func NewReadinessReporter() Reporter
Click to show internal directories.
Click to hide internal directories.