Documentation ¶
Overview ¶
Package action implements all the different actions an alert can take should its condition be found to be true
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
Action is a wrapper around an Actioner which contains some type information
func ToActioner ¶
ToActioner takes in some arbitrary data (hopefully a map[string]interface{}, looks at its "type" key, and any other fields necessary based on that type, and returns an Actioner (or an error)
type Actioner ¶
type Actioner interface { // Do takes in the alert context, and possibly returnes an error if the // action failed Do(context.Context) error }
Actioner describes an action type. There all multiple action types, but they all simply attempt to perform one action and that's it
type HTTP ¶
type HTTP struct { Method string `mapstructure:"method"` URL string `mapstructure:"url"` Headers map[string]string `mapstructure:"headers"` Body string `mapstructure:"body"` }
HTTP is an action which performs a single http request. If the request's response doesn't have a 2xx response code then it's considered an error