misc

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckProbeConfig added in v0.5.0

func CheckProbeConfig(probes []modules.Prober) error

CheckProbeConfig function does sanity checks on the probe definition.

func CheckProbeData added in v0.5.0

func CheckProbeData(pd *modules.ProbeData) error

CheckProbedata function verifies the correctness of the probe response.

func HandleConfig added in v0.5.0

func HandleConfig(config []byte) http.HandlerFunc

TODO: Return pure json instead of html.

func HandleHomePage added in v0.5.0

func HandleHomePage(w http.ResponseWriter, r *http.Request)

func HandleStatus added in v0.5.0

func HandleStatus(ps *ProbesStatus) http.HandlerFunc

Types

type ProbeStatus

type ProbeStatus struct {
	ProbeResp      *modules.ProbeData
	ProbeError     bool
	ProbeTimeout   bool
	ProbeStartTime int64
	ProbeEndTime   int64
}

type ProbesStatus

type ProbesStatus struct {
	Tmpl           TemplateParams
	Probes         []string
	ProbeStatusMap map[string]*ProbeStatus
	// contains filtered or unexported fields
}

func NewProbesStatus

func NewProbesStatus(p []string) *ProbesStatus

func (*ProbesStatus) ConvertToInt

func (ps *ProbesStatus) ConvertToInt(i *float64) int

func (*ProbesStatus) FormattedHttpBody

func (ps *ProbesStatus) FormattedHttpBody(body *[]byte) string

func (*ProbesStatus) FormattedHttpHeaders

func (ps *ProbesStatus) FormattedHttpHeaders(h http.Header) template.HTML

func (*ProbesStatus) FormattedTime

func (ps *ProbesStatus) FormattedTime(t *int64) time.Time

func (*ProbesStatus) ReadProbeStatus

func (ps *ProbesStatus) ReadProbeStatus(pn string) *ProbeStatus

func (*ProbesStatus) WriteProbeErrorStatus

func (ps *ProbesStatus) WriteProbeErrorStatus(pn string, st int64, et int64)

func (*ProbesStatus) WriteProbeStatus

func (ps *ProbesStatus) WriteProbeStatus(pn string, pd *modules.ProbeData, st int64, et int64)

func (*ProbesStatus) WriteProbeTimeoutStatus

func (ps *ProbesStatus) WriteProbeTimeoutStatus(pn string, st int64, et int64)

type TemplateParams

type TemplateParams struct {
	ShowParams  string // value can be all, single_probe
	ProbeSingle string // name of the probe to show in the templates when ShowParams==single_probe
}

Jump to

Keyboard shortcuts

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