Documentation
¶
Overview ¶
Package http provides the HTTP checker for the Wait4X application.
Index ¶
- Constants
- func New(address string, opts ...Option) checker.Checker
- type HTTP
- type Option
- func WithCAFile(path string) Option
- func WithCertFile(path string) Option
- func WithExpectBodyJSON(json string) Option
- func WithExpectBodyRegex(regex string) Option
- func WithExpectBodyXPath(xpath string) Option
- func WithExpectHeader(header string) Option
- func WithExpectStatusCode(code int) Option
- func WithH2C(enable bool) Option
- func WithInsecureSkipTLSVerify(insecureSkipTLSVerify bool) Option
- func WithKeyFile(path string) Option
- func WithNoRedirect(noRedirect bool) Option
- func WithRequestBody(body io.Reader) Option
- func WithRequestHeader(key string, value []string) Option
- func WithRequestHeaders(headers http.Header) Option
- func WithTimeout(timeout time.Duration) Option
Constants ¶
const ( // DefaultConnectionTimeout is the default connection timeout duration DefaultConnectionTimeout = 3 * time.Second // DefaultInsecureSkipTLSVerify is the default insecure skip tls verify DefaultInsecureSkipTLSVerify = false // DefaultNoRedirect is the default auto redirect DefaultNoRedirect = false )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP is an HTTP checker
type Option ¶
type Option func(h *HTTP)
Option configures an HTTP.
func WithCertFile ¶ added in v3.1.0
WithCertFile configures Cert file
func WithExpectBodyJSON ¶
WithExpectBodyJSON configures response json expectation
func WithExpectBodyRegex ¶
WithExpectBodyRegex configures response body expectation
func WithExpectBodyXPath ¶
WithExpectBodyXPath configures response xpath expectation
func WithExpectHeader ¶
WithExpectHeader configures response header expectation
func WithExpectStatusCode ¶
WithExpectStatusCode configures response status code expectation
func WithH2C ¶ added in v3.6.0
WithH2C enables prior-knowledge HTTP/2 over cleartext (h2c) for http:// URLs.
func WithInsecureSkipTLSVerify ¶
WithInsecureSkipTLSVerify configures insecure skip tls verify
func WithKeyFile ¶ added in v3.1.0
WithKeyFile configures key file
func WithNoRedirect ¶
WithNoRedirect configures auto redirect
func WithRequestBody ¶
WithRequestBody configures request body
func WithRequestHeader ¶
WithRequestHeader configures request header
func WithRequestHeaders ¶
WithRequestHeaders configures request header
func WithTimeout ¶
WithTimeout configures a time limit for requests made by the HTTP client