messenger

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

func Discord(ctx context.Context, ch <-chan interface{}, token string, userIDs []string) error

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.

func Slack

func Slack(ctx context.Context, ch <-chan interface{}, token string, chatIDs []string) error

Slack messenger processes events from a channel and attempts to communicate to one or more ChatIDs, optionally returning an error.

func Telegram

func Telegram(ctx context.Context, ch <-chan interface{}, apiKey string, chatIDs []string) error

Telegram messenger processes events from a channel and attempts to communicate to one or more ChatIDs, optionally returning an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL