Improve documentation

This commit is contained in:
TwinProduction 2020-09-01 00:29:17 -04:00
parent 42dd6a1e88
commit 0454854f04

View File

@ -17,16 +17,34 @@ var (
ErrNoUrl = errors.New("you must specify an url for each service") ErrNoUrl = errors.New("you must specify an url for each service")
) )
// Service is the configuration of a monitored endpoint
type Service struct { type Service struct {
Name string `yaml:"name"` // Name of the service. Can be anything.
Url string `yaml:"url"` Name string `yaml:"name"`
Method string `yaml:"method,omitempty"`
Body string `yaml:"body,omitempty"` // URL to send the request to
GraphQL bool `yaml:"graphql,omitempty"` Url string `yaml:"url"`
Headers map[string]string `yaml:"headers,omitempty"`
Interval time.Duration `yaml:"interval,omitempty"` // Method of the request made to the url of the service
Conditions []*Condition `yaml:"conditions"` Method string `yaml:"method,omitempty"`
Alerts []*Alert `yaml:"alerts"`
// Body of the request
Body string `yaml:"body,omitempty"`
// GraphQL is whether to wrap the body in a query param ({"query":"$body"})
GraphQL bool `yaml:"graphql,omitempty"`
// Headers of the request
Headers map[string]string `yaml:"headers,omitempty"`
// Interval is the duration to wait between every status check
Interval time.Duration `yaml:"interval,omitempty"`
// Conditions used to determine the health of the service
Conditions []*Condition `yaml:"conditions"`
// Alerts is the alerting configuration for the service in case of failure
Alerts []*Alert `yaml:"alerts"`
numberOfFailuresInARow int numberOfFailuresInARow int
} }