Documentation
¶
Index ¶
- func LoginAuth(username, password string) smtp.Auth
- type Config
- type MailConfig
- type Notification
- type Notifier
- func GetNotifiers(config Config, services []string) ([]Notifier, error)
- func NewDesktopNotifier(config Config) (Notifier, error)
- func NewJoinNotifier(config Config) (Notifier, error)
- func NewMailNotifier(config MailConfig) (Notifier, error)
- func NewRocketChatNotifier(config RocketChatConfig) (Notifier, error)
- func NewSlackNotifier(config SlackConfig) (Notifier, error)
- func NewTelegramNotifier(config TelegramConfig) (Notifier, error)
- type RocketChatConfig
- type SlackConfig
- type TelegramConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Mail MailConfig `yaml:"mail,omitempty"`
Notifications []Notification `yaml:"notifications,omitempty"`
RocketChat RocketChatConfig `yaml:"rocketchat,omitempty"`
Slack SlackConfig `yaml:"slack,omitempty"`
Telegram TelegramConfig `yaml:"telegram,omitempty"`
}
Config contains notifications and messaging services configurations.
type MailConfig ¶
type MailConfig struct {
SenderAddress string `yaml:"senderAddress,omitempty"`
SenderPassword string `yaml:"senderPassword,omitempty"`
SMTPHostAddress string `yaml:"smtpHostAddress,omitempty"`
SMTPHostPort string `yaml:"smtpHostPort,omitempty"`
ReceiverAddresses []string `yaml:"receiverAddresses,omitempty"`
}
MailConfig contains a mail's configuration.
type Notification ¶
type Notification struct {
// TODO: change to Notifiers?
Services []string `yaml:"services,omitempty"`
Delta time.Duration `yaml:"delta,omitempty"`
}
Notification ..
type Notifier ¶
Notifier is the interface that wraps the Notify method used to send notifications.
func GetNotifiers ¶
GetNotifiers returns the notifiers the user had set up.
func NewDesktopNotifier ¶
NewDesktopNotifier returns a notifier for desktop notifications.
func NewJoinNotifier ¶
NewJoinNotifier returns a notifier that displays a question dialog asking to join an online event or not.
func NewMailNotifier ¶
func NewMailNotifier(config MailConfig) (Notifier, error)
NewMailNotifier returns a notifier that sends mails.
func NewRocketChatNotifier ¶
func NewRocketChatNotifier(config RocketChatConfig) (Notifier, error)
NewRocketChatNotifier returns a notifier that sends rocket chat messages.
func NewSlackNotifier ¶
func NewSlackNotifier(config SlackConfig) (Notifier, error)
NewSlackNotifier returns a notifier that sends messages thorugh slack channels.
func NewTelegramNotifier ¶
func NewTelegramNotifier(config TelegramConfig) (Notifier, error)
NewTelegramNotifier returns a notifier that sends telegram messages.
type RocketChatConfig ¶
type RocketChatConfig struct {
ServerURL string `yaml:"serverURL,omitempty"`
UserID string `yaml:"userID,omitempty"`
Token string `yaml:"token,omitempty"`
RoomIDs []string `yaml:"roomIDs,omitempty"`
}
RocketChatConfig contains rocket chat's configuration.
type SlackConfig ¶
type SlackConfig struct {
BotAccessToken string `yaml:"botAccessToken,omitempty"`
ChannelIDs []string `yaml:"channelIDs,omitempty"`
}
SlackConfig contains slack's configuration.
type TelegramConfig ¶
type TelegramConfig struct {
BotAPIToken string `yaml:"botAPIToken"`
ChatIDs []int64 `yaml:"chatID"`
}
TelegramConfig contains telegram's configuration.