debugprobe

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2019 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Probe

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

func New

func New() *Probe

func (*Probe) APIGet

func (p *Probe) APIGet(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Probe) APIPut

func (p *Probe) APIPut(w http.ResponseWriter, r *http.Request, params httprouter.Params)

func (*Probe) AddRoutes

func (p *Probe) AddRoutes(r *httprouter.Router, base string)

func (*Probe) BindConfig

func (p *Probe) BindConfig(prefix string, v *viper.Viper, fs *pflag.FlagSet)

func (*Probe) Handle

func (p *Probe) Handle(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*Probe) SetConfig

func (p *Probe) SetConfig(c ProbeConfig)

type ProbeConfig

type ProbeConfig struct {
	// If failNext > 0, then fail next probe and decrement.  If failNext < 0, then
	// fail forever.
	FailNext int `json:"failNext" mapstructure:"fail-next"`
}

ProbeConfig is used to configure how the probe will respond

type ProbeHistory

type ProbeHistory struct {
	ID   int
	When time.Time
	Code int
}

type ProbeStatus

type ProbeStatus struct {
	ProbePath string               `json:"probePath"`
	FailNext  int                  `json:"failNext"`
	History   []ProbeStatusHistory `json:"history"`
}

ProbeStatus is returned from a GET to this API endpoing

type ProbeStatusHistory

type ProbeStatusHistory struct {
	ID      int    `json:"id"`
	When    string `json:"when"`
	RelWhen string `json:"relWhen"`
	Code    int    `json:"code"`
}

ProbeStatusHistory is a record of a probe call

Jump to

Keyboard shortcuts

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