Documentation
¶
Index ¶
- type Check
- func (check *Check) Config() core.MonitorConfiguration
- func (check *Check) Description() string
- func (check *Check) Name() string
- func (check *Check) Perform() (core.Status, error)
- func (check *Check) PerformGet() (core.Status, error)
- func (check *Check) Version() string
- func (check *Check) Watch(update chan<- *core.ServiceStatus, stop <-chan bool, wg *sync.WaitGroup) error
- type MonitorConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
// contains filtered or unexported fields
}
func (*Check) Config ¶
func (check *Check) Config() core.MonitorConfiguration
func (*Check) Description ¶
type MonitorConfiguration ¶
type MonitorConfiguration struct {
// URL of the service
URL string `mapstructure:"url"`
// Timeout is the duration to wait for a ping to finish, such as "1s"
Timeout time.Duration `mapstructure:"timeout"`
// Interval is the interval to use when watching the target, such as "1s"
Interval time.Duration `mapstructure:"interval"`
// Method is the HTTP method to use, such as "GET"
Method string `mapstructure:"method"`
// FollowRedirects specifies whether or not redirects should be followed
FollowRedirects bool `mapstructure:"followRedirects"`
// MaximumRedirects specifies the maximum number of redirects to follow before throwing an error
MaximumRedirects int `mapstructure:"maximumRedirects"`
// Expect is the matching clauses to determine an alive service
Expect struct {
// Status is the expected HTTP status
Status int `mapstructure:"status"`
// Regex is a regular expression that the body should match
Regex string `mapstructure:"regex"`
// CompiledRegex is the above regex in its compiled form
CompiledRegex *regexp.Regexp
} `mapstructure:"expect"`
}
func ParseConfiguration ¶
func ParseConfiguration(options map[string]interface{}) (*MonitorConfiguration, error)
func (*MonitorConfiguration) Validate ¶
func (config *MonitorConfiguration) Validate() []error
Click to show internal directories.
Click to hide internal directories.