Documentation ¶
Overview ¶
Package actions provides API to implement goma actions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("action not found")
)
Errors for actions.
Functions ¶
func Register ¶
func Register(name string, ctor Constructor)
Register registers a constructor of a kind of probes.
Types ¶
type Actor ¶
type Actor interface { // Init is called when goma starts monitoring. // // name is the monitor name. // Non-nil error is logged, and STOPS the monitor. Init(name string) error // Fail is called when a probe is start failing. // // name is the monitor name. // v is the returned value from the probe (or a value from the filter). // Non-nil error is logged, but will not stop the monitor. Fail(name string, v float64) error // Recover is called when a probe is recovered from failure. // // name is the monitor name. // d is the failure duration. // Non-nil error is logged, but will not stop the monitor. // // Note that this may not always be called if goma is stopped // during failure. Init is the good place to correct such status. Recover(name string, d time.Duration) error // String returns a descriptive string for this action. String() string }
Actor is the interface for actions.
type Constructor ¶
Constructor is a function to create an action.
params are configuration options for the action.
Directories ¶
Path | Synopsis |
---|---|
Package all import all actions to be compiled-in.
|
Package all import all actions to be compiled-in. |
Package exec implements "exec" action type that runs arbitrary commands.
|
Package exec implements "exec" action type that runs arbitrary commands. |
Package http implements "http" action type that send events to HTTP(S) server.
|
Package http implements "http" action type that send events to HTTP(S) server. |
Package mail implements "mail" action type that send mails.
|
Package mail implements "mail" action type that send mails. |
Click to show internal directories.
Click to hide internal directories.