Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSender ¶
RegisterSender makes a Sender available by the provided name.
If called twice with the same name, the name is blank, or if the provided Sender is nil, this function panics.
Types ¶
type Config ¶
type Config struct { Attempts int Level types.Level Params map[string]interface{} `yaml:",inline"` }
Config is the configuration for the Notifier service and its registered notifiers.
type DefaultNotificationSender ¶
type DefaultNotificationSender struct {
// contains filtered or unexported fields
}
DefaultNotificationSender - default notification sender, manages configuration
func (*DefaultNotificationSender) Configure ¶
func (m *DefaultNotificationSender) Configure(config *Config) (bool, error)
Configure - configure is used to register multiple notification senders
func (*DefaultNotificationSender) Send ¶
func (m *DefaultNotificationSender) Send(event types.EventNotification) error
Send - send notifications through all configured senders
func (*DefaultNotificationSender) Senders ¶
func (m *DefaultNotificationSender) Senders() map[string]Sender
Senders returns the list of the registered Senders.
func (*DefaultNotificationSender) UnregisterSender ¶
func (m *DefaultNotificationSender) UnregisterSender(name string)
UnregisterSender removes a Sender with a particular name from the list.
type Sender ¶
type Sender interface { // Configure attempts to initialize the notifier with the provided configuration. // It returns whether the notifier is enabled or not. Configure(*Config) (bool, error) // Send informs the existence of the specified notification. Send(event types.EventNotification) error }
Sender represents anything that can transmit notifications.
Click to show internal directories.
Click to hide internal directories.