Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Location is the unique location name of this monitor.
Location string
// PublicURL is the publicly-routable base URL for this monitor.
// It must match what is configured for twilio SMS.
PublicURL string
// ListenAddr is the address and port to bind to.
ListenAddr string
// CheckMinutes denotes the number of minutes between checks (for all instances).
CheckMinutes int
Twilio struct {
AccountSID string
AuthToken string
FromNumber string
}
// Instances determine what remote GoAlert instances will be monitored and send potential errors.
Instances []Instance
}
Config contains all necessary values for remote monitoring.
type Instance ¶
type Instance struct {
// Location must be unique.
Location string
// TestAPIKey is used to create test alerts.
// The service it points to should have an escalation policy that allows at least 60 seconds
// before escalating to a human. It should send initial notifications to the monitor via SMS.
TestAPIKey string
// ErrorAPIKey is the key used to create new alerts for encountered errors.
ErrorAPIKey string
// HeartbeatURLs are sent a POST request after a successful test cycle for this instance.
HeartbeatURLs []string
// PublicURL should point to the publicly-routable base of the instance.
PublicURL string
// Phone is the number that incomming SMS messages from this instances will be from.
// Must be unique between all instances.
Phone string
// ErrorsOnly, if set, will disable creating test alerts for the instance. Any error-alerts will
// still be generated, however.
ErrorsOnly bool
}
An Instance represents a running remote GoAlert instance to monitor.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor will check for functionality and communication between itself and one or more instances. Each monitor should have a unique phone number and location.
func NewMonitor ¶
NewMonitor creates and starts a new Monitor with the given Config.
Click to show internal directories.
Click to hide internal directories.