Documentation ¶
Index ¶
- type CheckHTTP
- type Option
- func WithAllowedStatusCode(status int) Option
- func WithBasicAuth(username, password string) Option
- func WithBody(body []byte) Option
- func WithHTTPClient(client *http.Client) Option
- func WithMethod(method string) Option
- func WithRegexp(expr string) Option
- func WithoutAllowedStatusCode(status int) Option
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckHTTP ¶
type CheckHTTP struct {
// contains filtered or unexported fields
}
CheckHTTP is an HTTP healthz check
Example ¶
checker := healthz.NewChecker() chk, err := NewCheck("http://example.com/path") if err != nil { log.Fatal(err) } checker.AddCheck("remote_service", chk) http.ListenAndServe(":8080", checker)
Output:
type Option ¶
type Option func(*options) error
Option is used to customize the summarizer
func WithAllowedStatusCode ¶
WithAllowedStatusCode adds a status code that won't trigger an error
func WithBasicAuth ¶
WithBasicAuth sets basic auth credentials to be used for each request
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client to use for the checks
func WithMethod ¶
WithMethod sets the HTTP method to use for the checks
func WithRegexp ¶
WithRegexp performs a content check on the body of the HTTP response.
func WithoutAllowedStatusCode ¶
WithoutAllowedStatusCode removes a status code from the list of allowed codes. This is useful to remove the default 200 status code
Click to show internal directories.
Click to hide internal directories.