Documentation ¶
Index ¶
Constants ¶
View Source
const ( NOTIFICATION_EMAIL = "email" NOTIFICATION_PUSHOVER = "pushover" NOTIFICATION_TELEGRAM = "telegram" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Email ¶
type Email struct {
// contains filtered or unexported fields
}
func NewEmail ¶
func NewEmail(config EmailConfig) (*Email, error)
func (*Email) SendNotification ¶
func (e *Email) SendNotification(notification *Notification) error
type EmailConfig ¶
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
func (*Mailer) EncodeRFC2047 ¶
Use the mail package RFC 2047 to encode any string
type Notification ¶
func NewNotification ¶
func NewNotification(title string, text string) *Notification
func (*Notification) GetMessengerText ¶
func (n *Notification) GetMessengerText() string
Return the messenger text message containing title + message text to be used for Telegram, etc...
type NotificationMethod ¶
type NotificationMethod string
type NotificationReceiver ¶
type NotificationReceiver struct { Method NotificationMethod `mapstructure:"Method"` // Email SmtpHost string `mapstructure:"SmtpHost"` SmtpPort int `mapstructure:"SmtpPort"` AllowSelfSigned bool `mapstructure:"AllowSelfSigned"` FromAddress string `mapstructure:"FromAddress"` FromPassword string `mapstructure:"FromPassword"` RecAddress string `mapstructure:"RecAddress"` // Pushover AppToken string `mapstructure:"AppToken"` Receiver string `mapstructure:"Receiver"` // Telegram Token string `mapstructure:"Token"` Channel string `mapstructure:"Channel"` }
type Notifier ¶
type Notifier interface {
SendNotification(notification *Notification) error
}
func CreateAndSendNotification ¶
func CreateAndSendNotification(sendData *Notification, notify *NotificationReceiver) (Notifier, error)
type Pushover ¶
type Pushover struct {
// contains filtered or unexported fields
}
func NewPushover ¶
func NewPushover(config PushoverConfig) (*Pushover, error)
func (*Pushover) SendNotification ¶
func (p *Pushover) SendNotification(notification *Notification) error
type PushoverConfig ¶
type PusoverResponse ¶
type Telegram ¶
type Telegram struct {
// contains filtered or unexported fields
}
func NewTelegram ¶
func NewTelegram(config TelegramConfig) (*Telegram, error)
func (*Telegram) SendNotification ¶
func (t *Telegram) SendNotification(notification *Notification) error
type TelegramConfig ¶
type TelegramResponse ¶
Click to show internal directories.
Click to hide internal directories.