actuator

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusUp   = "UP"
	StatusDown = "DOWN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultHealthService

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

func (DefaultHealthService) Check

type DefaultInfoService

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

func (DefaultInfoService) Info

func (d DefaultInfoService) Info() Info

type Health

type Health struct {
	Status     string                   `json:"status"`
	Components map[string]StatusDetails `json:"components,omitempty"`
}

Health is a model represents for service health status. Includes Status UP or DOWN (see StatusUp, StatusDown), and a map of Components under test (with key is component name, value is StatusDetails)

type HealthChecker

type HealthChecker interface {

	// Component returns the name of
	// component under test
	Component() string

	// Check status of current component,
	// Return status details includes status: UP or DOWN,
	// and the reason if it's down
	Check(ctx context.Context) StatusDetails
}

HealthChecker is an interface that implemented by component

type HealthService

type HealthService interface {
	Check(ctx context.Context) Health
}

func NewDefaultHealthService

func NewDefaultHealthService(checkers []HealthChecker) HealthService

type Info

type Info struct {
	Name string                 `json:"service_name"`
	Info map[string]interface{} `json:"info,omitempty"`
}

Info is a model represents for service info. Includes Name is the service name and a map of Info with key and value

type InfoService

type InfoService interface {
	Info() Info
}

func NewDefaultInfoService

func NewDefaultInfoService(props *config.AppProperties, informers []Informer) InfoService

type Informer

type Informer interface {

	// Key returns the key of this information
	Key() string

	// Value returns the value of this information
	Value() interface{}
}

Informer is an interface that implemented by component to provide their information

type StatusDetails

type StatusDetails struct {
	Status string `json:"status"`
	Reason string `json:"reason,omitempty"`
}

StatusDetails is a model represents for component's status. Includes status UP or DOWN (see StatusUp, StatusDown), and the reason if it's down

Jump to

Keyboard shortcuts

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