health

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check func() error

Check

func DNSProbeCheck

func DNSProbeCheck(host string, timeout time.Duration) Check

DNSProbeCheck returns a Check that determines wheteher service with specified dns name is reachable or not using net.Resolver's LookupHost method.

func HTTPGetCheck

func HTTPGetCheck(url string, timeout time.Duration) Check

HTTPGetCheck returns a Check that performs an HTTP GET request to the specified URL. It fails whether timeout is reached or non-200-OK status code returned.

type Checker

type Checker interface {
	AddLiveness(name string, check Check)
	AddReadiness(name string, check Check)
	Handler() http.Handler
	RegisterHandler(mux *http.ServeMux)
}

Checker ...

func NewChecksHandler

func NewChecksHandler(healthPath, readyPath string) Checker

NewChecksHandler accepts two strings: health and ready paths. These paths will be used for liveness and readiness checks.

Jump to

Keyboard shortcuts

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