http

package
v1.13.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoHTTPProbe

func DoHTTPProbe(url *url.URL, headers http.Header, client GetHTTPInterface) (probe.Result, string, error)

DoHTTPProbe checks if a GET request to the url succeeds. 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. This is exported because some other packages may want to do direct HTTP probes.

Types

type GetHTTPInterface added in v1.13.0

type GetHTTPInterface interface {
	Do(req *http.Request) (*http.Response, error)
}

GetHTTPInterface is an interface for making HTTP requests, that returns a response and error.

type Prober added in v1.13.0

type Prober interface {
	Probe(url *url.URL, headers http.Header, timeout time.Duration) (probe.Result, string, error)
}

Prober is an interface that defines the Probe function for doing HTTP readiness/liveness checks.

func New

func New() Prober

New creates Prober that will skip TLS verification while probing.

func NewWithTLSConfig added in v1.7.0

func NewWithTLSConfig(config *tls.Config) Prober

NewWithTLSConfig takes tls config as parameter.

Jump to

Keyboard shortcuts

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