Documentation
¶
Index ¶
- Variables
- func AddLivenessIndicator(name string, idc Indicator)
- func AddLivenessIndicatorFunc(name string, f func() (string, map[string]interface{}))
- func AddReadinessIndicator(name string, idc Indicator)
- func AddReadinessIndicatorFunc(name string, f func() (string, map[string]interface{}))
- type Details
- type Endpoint
- type Health
- type Indicator
- type IndicatorAdapter
- type Status
Constants ¶
This section is empty.
Variables ¶
var ( // INIT means it is starting INIT = Status("INIT") // UP means it is healthy UP = Status("UP") // DOWN means it is unhealthy DOWN = Status("DOWN") )
Functions ¶
func AddLivenessIndicator ¶
AddLivenessIndicator register health.Indicator for liveness check.It's not concurrent-safe,so please invoke it ONLY in init method.
func AddLivenessIndicatorFunc ¶
AddLivenessIndicatorFunc register health.Indicator for liveness check.Indicator.It's not concurrent-safe,so please invoke it ONLY in init method.
func AddReadinessIndicator ¶
AddReadinessIndicator register health.Indicator for readiness check.Indicator.It's not concurrent-safe,so please invoke it ONLY in init method.
func AddReadinessIndicatorFunc ¶
AddReadinessIndicatorFunc register health.Indicator for readiness check.Indicator.It's not concurrent-safe,so please invoke it ONLY in init method.
Types ¶
type Details ¶
type Details = map[string]interface{}
Details hold additional contextual details about the health of a component.
func NewDetails ¶
func NewDetails() Details
type Endpoint ¶
type Endpoint struct { }
func NewEndpoint ¶
func NewEndpoint() *Endpoint
func (*Endpoint) Handle ¶
func (e *Endpoint) Handle(ctx context.Context, params http.ParamsScanner) (map[string]interface{}, error)
Handle will check health status.The structure of the returned map is like:
{ "status": "DOWN", "components": { "readinessProbe": { "status": "DOWN", "details": {} } } }
type Health ¶
Health carries information about the health of a component. Details are optional.
type IndicatorAdapter ¶
func (IndicatorAdapter) Report ¶
func (ca IndicatorAdapter) Report() (status Status, details map[string]interface{})