From 80fca4a6175ff73c6e1e18b74a09b0abc65b4b2d Mon Sep 17 00:00:00 2001 From: KrishanBhalla Date: Sat, 30 Jan 2021 21:07:06 +0000 Subject: [PATCH] Updating the Notifier Interface --- notify.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/notify.go b/notify.go index fc50186..7967c2f 100644 --- a/notify.go +++ b/notify.go @@ -15,10 +15,17 @@ type Notify struct { // ErrSendNotification signals that the notifier failed to send a notification. var ErrSendNotification = errors.New("Send notification") -// 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. +// 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 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 { Send(string, string) error + AddRecievers(...interface{}) } // New returns a new instance of Notify. Defaulting to being not disabled and using the pseudo notification