prober

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prober

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

Prober represents health and readiness status of given component.

func NewProber

func NewProber(component component.Component, logger log.Logger, reg prometheus.Registerer) *Prober

NewProber returns Prober representing readiness and healthiness of given component.

func (*Prober) HandleIfReady

func (p *Prober) HandleIfReady(f http.HandlerFunc) http.HandlerFunc

HandleIfReady if probe is ready calls the function otherwise returns 503.

func (*Prober) IsHealthy

func (p *Prober) IsHealthy() error

IsHealthy returns error if component is not healthy and nil if it is.

func (*Prober) IsReady

func (p *Prober) IsReady() error

IsReady returns error if component is not ready and nil otherwise.

func (*Prober) RegisterInMux

func (p *Prober) RegisterInMux(mux *http.ServeMux)

RegisterInMux registers readiness and liveness probes to mux.

func (*Prober) RegisterInRouter

func (p *Prober) RegisterInRouter(router *route.Router)

RegisterInRouter registers readiness and liveness probes to router.

func (*Prober) SetHealthy

func (p *Prober) SetHealthy()

SetHealthy sets components status to healthy.

func (*Prober) SetNotHealthy

func (p *Prober) SetNotHealthy(err error)

SetNotHealthy sets components status to not healthy with given error as a cause.

func (*Prober) SetNotReady

func (p *Prober) SetNotReady(err error)

SetNotReady sets components status to not ready with given error as a cause.

func (*Prober) SetReady

func (p *Prober) SetReady()

SetReady sets components status to ready.

Jump to

Keyboard shortcuts

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