mirror of
https://github.com/nikoksr/notify.git
synced 2025-02-01 12:58:01 +02:00
Updating the Notifier Interface
This commit is contained in:
parent
f14ac841f6
commit
80fca4a617
11
notify.go
11
notify.go
@ -15,10 +15,17 @@ type Notify struct {
|
|||||||
// ErrSendNotification signals that the notifier failed to send a notification.
|
// ErrSendNotification signals that the notifier failed to send a notification.
|
||||||
var ErrSendNotification = errors.New("Send notification")
|
var ErrSendNotification = errors.New("Send notification")
|
||||||
|
|
||||||
// Notifier defines the behavior for notification services. The Send command simply sends a message string to the
|
// Notifier defines the behavior for notification services. It implements Send and AddReciever
|
||||||
// internal destination Notifier. E.g for telegram it sends the message to the specified group chat.
|
//
|
||||||
|
// 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 AddRecievers method takes one or many interfaces (ints, strings etc.) depending
|
||||||
|
// on the underlying notifier. When sending, these form the targets.
|
||||||
|
// e.g. slack channels, telegram chats, email addresses.
|
||||||
type Notifier interface {
|
type Notifier interface {
|
||||||
Send(string, string) error
|
Send(string, string) error
|
||||||
|
AddRecievers(...interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new instance of Notify. Defaulting to being not disabled and using the pseudo notification
|
// New returns a new instance of Notify. Defaulting to being not disabled and using the pseudo notification
|
||||||
|
Loading…
x
Reference in New Issue
Block a user