http

package
Version: v0.0.0-...-3ab4a19 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoHTTPProbe

func DoHTTPProbe(url string, client HTTPGetInterface) (probe.Result, 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 HTTPGetInterface

type HTTPGetInterface interface {
	Get(u string) (*http.Response, error)
}

type HTTPProber

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

func New

func New() HTTPProber

func (*HTTPProber) Probe

func (pr *HTTPProber) Probe(host string, port int, path string, timeout time.Duration) (probe.Result, error)

Probe returns a ProbeRunner capable of running an http check.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL