Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alerter ¶
type Alerter interface {
Alert(ContainerRestartEvent) error
}
Alerter represents something that can trigger an alert to an external service. For example, to slack, or opsgenie.
func NewLogAlerter ¶
func NewLogAlerter() Alerter
NewLogAlerter is just a constructor, dead useful docstring this. Love linters.
func NewSlackAlerter ¶
NewSlackAlerter creates a slack alerter with the correct webhooks, channel and returns it as the Alerter interface.
type ContainerRestartEvent ¶
type LogAlerter ¶
type LogAlerter bool
LogAlerter is a dead simple alerter which simply logs to console.
func (LogAlerter) Alert ¶
func (la LogAlerter) Alert(cre ContainerRestartEvent) error
Alert implements the Alerter interface for LogAlerter.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all the available alerters to be used by deadman switches.
func NewRegistry ¶
func NewRegistry() Registry
NewRegistry simply allocates a new registry with all fields properly created.
func NewRegistryFromConfig ¶
NewRegistryFromConfig will create a Registry from a viper/json config file.
func (*Registry) AddAlerter ¶
AddAlerter adds an alerter to the registry.
func (*Registry) GetAlerter ¶
GetAlerter finds the alerter associated with a name.
type SlackAlerter ¶
type SlackAlerter struct {
// contains filtered or unexported fields
}
SlackAlerter is an alerter which sends its alert messages to a slack channel, over a webhook.
func (SlackAlerter) Alert ¶
func (a SlackAlerter) Alert(cre ContainerRestartEvent) error
Alert implements the Alerter interface.