Documentation ¶
Overview ¶
Package alerts contains code relating to the storage and manipulation of alerts.
Index ¶
- type AlertRaise
- type Alerts
- func (s *Alerts) AckEvent(id string) error
- func (s *Alerts) AddEvent(data alert.Alert) error
- func (s *Alerts) AddUser(user string, pass string) error
- func (s *Alerts) Alerts() ([]alert.Alert, error)
- func (s *Alerts) ClearEvent(id string) error
- func (s *Alerts) Close()
- func (s *Alerts) DelUser(user string) error
- func (s *Alerts) GetAlert(id int) (alert.Alert, error)
- func (s *Alerts) GetUsers() ([]string, error)
- func (s *Alerts) Notify(callback AlertRaise, config string) error
- func (s *Alerts) RaiseEvent(id string) error
- func (s *Alerts) Reap() error
- func (s *Alerts) Renotify(callback AlertRaise, config string) error
- func (s *Alerts) ValidateLogin(user string, pass string) (bool, error)
- func (s *Alerts) Warp() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertRaise ¶
AlertRaise is a function-signature.
When an alert becomes raised we need to notify a human, we don't have support for doing that directly, instead we execute an external process to do that - here is the callback function which is invoked to do that.
type Alerts ¶
type Alerts struct {
// contains filtered or unexported fields
}
Alerts is our object for interfacing with alerts.
func (*Alerts) ClearEvent ¶
ClearEvent changes the state of the given alert to be "cleared".
func (*Alerts) Close ¶
func (s *Alerts) Close()
Close ensures that our database-connection is closed.
func (*Alerts) Notify ¶
func (s *Alerts) Notify(callback AlertRaise, config string) error
Notify is called to trigger the _initial_ notification for any event which has become raised.
It will not be involved in _re_notification.
func (*Alerts) RaiseEvent ¶
RaiseEvent changes the state of the given alert to be "raised".
func (*Alerts) Renotify ¶
func (s *Alerts) Renotify(callback AlertRaise, config string) error
Renotify triggers notifications for any alerts which continue to be outstanding.
func (*Alerts) ValidateLogin ¶
ValidateLogin tests a given User/Pass pair for validity