probes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpProber

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

func NewHTTPProber

func NewHTTPProber() HttpProber

New creates Prober that will skip TLS verification while probing.

func NewWithTLSConfig

func NewWithTLSConfig(config *tls.Config) HttpProber

func (HttpProber) Probe

func (pr HttpProber) Probe(url *url.URL, headers http.Header, timeout time.Duration) (ProbeResult, string, error)

Probe returns a ProbeRunner capable of running an HTTP check. If the HTTP response code is successful (i.e. 400 > code >= 200), it returns Success. If the HTTP response code is unsuccessful or HTTP communication fails, it returns Failure.

type ProbeResult

type ProbeResult string
const (
	Success ProbeResult = "success"
	Warning ProbeResult = "warning"
	Failure ProbeResult = "failure"
	Unknown ProbeResult = "unknown"
)

type TcpProber

type TcpProber struct{}

func NewTcpProber

func NewTcpProber() TcpProber

Creates a new TCP prober

func (TcpProber) Probe

func (pr TcpProber) Probe(host string, port int, timeout time.Duration) (ProbeResult, error)

Probe returns a ProbeRunner capable of running an TCP check. If the socket can be opened, it returns Success If the socket fails to open, it returns Failure.

Jump to

Keyboard shortcuts

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