reporter

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

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

type Component interface {
	status.Source
	SetStatus(respStatus int, metadata interface{})
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL