mirror of
https://github.com/nikoksr/notify.git
synced 2024-11-28 08:39:13 +02:00
refactor(notifier): remove AddReceivers function from notify.Notifier interface
AddReceivers was added to the notify.Notifier interface in 3d7cc206e1
and the fact that it shouldn't be there was obviously overlooked during
the code review.
The AddReceivers function is present in all services so far, but it does
not define the behavior of our services. The behavior is defined only by
the Send function. The AddReceivers function is also not called once in
the code on a notify.notifier. This can also be seen by the fact that I
can remove the AddReceivers function from the notify.Notifier interface
without getting any errors in the rest of the code.
This commit is contained in:
parent
b3cad8fe68
commit
bd82278932
11
notifier.go
11
notifier.go
@ -1,14 +1,9 @@
|
||||
package notify
|
||||
|
||||
// Notifier defines the behavior for notification services. It implements Send and AddReciever
|
||||
// Notifier defines the behavior for notification services.
|
||||
//
|
||||
// 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 receiving messages
|
||||
// e.g. slack channels, telegram chats, email addresses.
|
||||
// The Send function simply sends a subject and a message string to the internal destination Notifier.
|
||||
// E.g for telegram.Telegram it sends the message to the specified group chat.
|
||||
type Notifier interface {
|
||||
Send(string, string) error
|
||||
AddReceivers(...string)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user