Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSendNotification = errors.New("send notification")
ErrSendNotification signals that the notifier failed to send a notification.
Functions ¶
This section is empty.
Types ¶
type Notifier ¶
Notifier defines the behavior for notification services. It implements Send and AddReciever
The Send command simply sends a message string to the internal destination Notifier.
E.g for telegram it sends the message to the specified group chat.
The AddReceivers takes one or many strings and adds these to the list of destinations for recieving messages e.g. slack channels, telegram chats, email addresses.
type Notify ¶
type Notify struct { Disabled bool // contains filtered or unexported fields }
Notify is the central struct for managing notification services and sending messages to them.
func New ¶
func New() *Notify
New returns a new instance of Notify. Defaulting to being not disabled
func (Notify) Send ¶
Send calls the underlying notification services to send the given message to their respective endpoints.
func (*Notify) UseService ¶
UseService adds a given service to the notifiers services list.