Documentation ¶
Index ¶
- Constants
- Variables
- 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 ( MailSendDelay = 50 * time.Millisecond MailSubject = "Nova ocjena iz e-Dnevnika" )
View Source
const (
DiscordSendDelay = 50 * time.Millisecond // recommended delay between messages
)
Variables ¶
View Source
var ( ErrDiscordEmptyAPIKey = errors.New("empty Discord API key") ErrDiscordEmptyUserIds = errors.New("empty list of Discord User IDs") ErrDiscordCreatingSession = errors.New("error creating Discord session") ErrDiscordCreatingChannel = errors.New("error creating Discord channel") ErrDiscordSendingMessage = errors.New("error sending Discord message") )
View Source
var ( ErrMailSendingMessage = errors.New("error sending mail message") ErrMailInvalidPort = errors.New("invalid or missing SMTP port, will try with default 465/tcp") )
Functions ¶
func Discord ¶
func Discord(ctx context.Context, ch <-chan interface{}, token string, userIDs []string, retries uint) 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, retries uint) 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.