health

package
v0.0.0-...-0fda810 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHTTPProbes

func RegisterHTTPProbes(r *mux.Router, c conditions)

RegisterHTTPProbes adds the probe api to the given router

Types

type Condition

type Condition struct {
	Ready   bool   `json:"ready"`
	Message string `json:"message,omitempty"`
	Name    string `json:"name"`
}

Condition contains the information regarding the status of a piece of the System

type ConditionCheck

type ConditionCheck func() Condition

ConditionCheck defines the API for functions that check the condition of the system

type Conditions

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

Conditions holds the health and readiness conditions and verifies if they have been met

func NewConditions

func NewConditions(app info.App, instance info.Instance) *Conditions

NewConditions creates a Conditions object, for which to register health and readiness conditions

func (*Conditions) IsAlive

func (c *Conditions) IsAlive() (bool, interface{})

IsAlive checks whether the health conditions are met

func (*Conditions) IsReady

func (c *Conditions) IsReady() (bool, interface{})

IsReady checks whether the ready conditions are met

func (*Conditions) RegisterHealthCondition

func (c *Conditions) RegisterHealthCondition(condition ConditionCheck)

RegisterHealthCondition adds a condition that must pass in order for the health probe to respond with 200

func (*Conditions) RegisterReadynessCondition

func (c *Conditions) RegisterReadynessCondition(condition ConditionCheck)

RegisterReadynessCondition adds a condition that must pass in order for the readiness probe to respond with 200

type Status

type Status struct {
	App      info.App      `json:"app"`
	Instance info.Instance `json:"instance"`
	Status   []Condition   `json:"status"`
}

Status models the status of the app and the meta information of the instance

Jump to

Keyboard shortcuts

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