Documentation
¶
Index ¶
- Constants
- func New(address string, opts ...Option) checker.Checker
- type HTTP
- type 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 WithInsecureSkipTLSVerify(insecureSkipTLSVerify bool) 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 ¶
View Source
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 represents HTTP checker
type Option ¶
type Option func(h *HTTP)
Option configures an HTTP.
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 WithInsecureSkipTLSVerify ¶
WithInsecureSkipTLSVerify configures insecure skip tls verify
func WithNoRedirect ¶ added in v2.8.0
WithNoRedirect configures auto redirect
func WithRequestBody ¶ added in v2.8.0
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
Click to show internal directories.
Click to hide internal directories.