Documentation
¶
Index ¶
Constants ¶
View Source
const ( MsgTypeNew = "new" MsgTypeResolve = "resolve" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Check ¶
type Check struct {
*CheckLoad `bson:",inline"`
Attempts int `json:"attempts"`
Duration float64 `json:"duration"`
ExecutedAt time.Time `json:"executed_at" bson:"executed_at"`
History []int `json:"history"`
IssuedAt time.Time `json:"issued_at" bson:"issued_at"`
PreviousOutput string `json:"previous_output" bson:"previous_output"`
Output string `json:"output"`
Status int `json:"status"`
Handlers []*Handler `json:"-" bson:"-"`
}
Check represents a check
type CheckLoad ¶
type CheckLoad struct {
Name string `json:"name"`
Command string `json:"command"`
Interval int `json:"interval"`
MaxAttempts int `json:"max_attempts" bson:"max_attempts"`
HandlerNames []string `json:"handlers" bson:"handlers"`
Renotify bool `json:"renotify"`
}
CheckLoad is used to load a check from a file, and then it gets converted to a Check
type Event ¶
type Handler ¶
type Handler struct {
Name string `json:"name"`
Type string `json:"type"`
Handler HandlerSender `json:"handler,omitempty" bson:"-"`
}
Handler represents a notification handler
func NewConsoleHandler ¶
func NewConsoleHandler() *Handler
NewConsoleHandler creates a consoleHandler instance
func NewSendGridHandler ¶
func NewSendGridHandler(apiKey, subjectPrefix, from, fromName, to, toName string, notifyOnResolve bool) *Handler
NewSendGridHandler creates a sendGridHandler instance
func NewSlackHandler ¶
NewSlackHandler creates a slackHandler instance
type HandlerSender ¶
HandlerSender is a common interface for all handlers
Click to show internal directories.
Click to hide internal directories.