Documentation ¶
Index ¶
- Constants
- func Discord(ctx context.Context, ch <-chan interface{}, token string, userIDs []string) error
- func Mail(ctx context.Context, ch <-chan interface{}, ...) error
- func Slack(ctx context.Context, ch <-chan interface{}, token string, chatIDs []string) error
- func Telegram(ctx context.Context, ch <-chan interface{}, apiKey string, chatIDs []string) error
Constants ¶
View Source
const ( DiscordSendDelay = 50 * time.Millisecond // recommended delay between messages ErrDiscordEmptyAPIKey = "empty Discord API key" ErrDiscordEmptyUserIds = "empty list of Discord User IDs" ErrDiscordCreatingSession = "Error creating Discord session: %v" ErrDiscordCreatingChannel = "Error creating Discord channel: %v" ErrDiscordSendingMessage = "Error sending Discord message: %v" )
View Source
const ( MailSendDelay = 50 * time.Millisecond MailSubject = "Nova ocjena iz e-Dnevnika" ErrMailSendingMessage = "Error sending mail message: %v" ErrMailInvalidPort = "Invalid or missing SMTP port, will try with default 465/tcp" )
View Source
const ( ErrSlackEmptyAPIKey = "empty Slack API key" ErrSlackEmptyUserIds = "empty list of Slack Chat IDs" ErrSlackSendingMessage = "Error sending Slack message: %v" )
View Source
const ( ErrTelegramEmptyAPIKey = "empty Telegram API key" ErrTelegramEmptyUserIds = "empty list of Telegram Chat IDs" ErrTelegramInvalidChatID = "Invalid Telegram Chat ID: %v" ErrTelegramSendingMessage = "Error sending Telegram message: %v" )
Variables ¶
This section is empty.
Functions ¶
func Discord ¶
Discord messenger processes events from a channel and attempts to communicate to one or more UserIDs, optionally returning an error.
func Mail ¶
func Mail(ctx context.Context, ch <-chan interface{}, server, port, username, password, from, subject string, to []string, ) error
Mail messenger processes events from a channel and attempts to send emails to one or more recipients, optionally returning an error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.