Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check interface { Initialize(context.Context) error Configure(map[string]interface{}) error Run() ([]byte, error) }
Check interface is the interface that all checks has to implement
func FromString ¶
FromString returns a `Check` parsed by a string
type HTTPCheck ¶
type HTTPCheck struct {
// contains filtered or unexported fields
}
HTTPCheck is a struct that defines the HTTP check. It holds the HTTP client and an HTTPCheckConfig struct.
func (*HTTPCheck) Configure ¶
Configure decodes map[string]interface{} to an HTTPCheckConfig struct instance. It does so using `mapstructure`. After decoding, it configures some default values in case they were not given in the configuration.
func (*HTTPCheck) GetFullURL ¶
GetFullURL returns the string represantation of the check's URL
func (*HTTPCheck) Initialize ¶
Initialize initializing an HTTP client for the HTTPCheck.
type HTTPCheckConfig ¶
type HTTPCheckConfig struct { URL string `mapstructure:"url"` Method string `mapstructure:"method"` Payload []byte `mapstructure:"payload"` ErrorHTTPStatusCodes []int `mapstructure:"error_http_status_codes"` // contains filtered or unexported fields }
HTTPCheckConfig is a struct that holds the configuration required for the HTTP check. It is populated with `mapstructure` and holds some private fields that suppose to hold a parsed/verified version of the configuration input.