actuator

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(ctx context.Context, cfg *config.Config)

func SetHealth

func SetHealth(check string, status Status, message string)
Example
SetHealth("Printer", Down, "no more ink")
Output:

Types

type HealthAccumulator

type HealthAccumulator struct {
	// contains filtered or unexported fields
}

func NewHealthAccumulator

func NewHealthAccumulator(clock clock.Clock) *HealthAccumulator

func (*HealthAccumulator) Register

func (h *HealthAccumulator) Register(component string, check HealthCheck)

func (*HealthAccumulator) Run

func (h *HealthAccumulator) Run(appCtx context.Context)

type HealthActuator

type HealthActuator struct {
	// contains filtered or unexported fields
}
var HealthAggregator *HealthActuator

func (*HealthActuator) ServeHTTP

func (h *HealthActuator) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*HealthActuator) Set

func (h *HealthActuator) Set(check string, status Status, message string)

func (*HealthActuator) Status

func (h *HealthActuator) Status() Status

type HealthCheck

type HealthCheck func(ctx context.Context) (status Status, message string)

type HealthStatus

type HealthStatus struct {
	Status Status `json:"status"`

	Components map[string]StatusComponent `json:"components"`
}

type InfoHandler

type InfoHandler struct {
	// contains filtered or unexported fields
}

func NewInfoHandler

func NewInfoHandler() *InfoHandler

func (*InfoHandler) ServeHTTP

func (v *InfoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Status

type Status string
const (
	Down         Status = "DOWN"
	Up           Status = "UP"
	OutOfService Status = "OUT_OF_SERVICE"
	Unknown      Status = "UNKNOWN"
)

type StatusComponent

type StatusComponent struct {
	Status  Status `json:"status"`
	Message string `json:"message,omitempty"`
}

Jump to

Keyboard shortcuts

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