Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NewGmailNotifier = func(config Config) (Notifier, error) { if config.Type != "gmail" { return nil, errors.New("gmail: invalid config type") } if config.Config["user"] == "" { return nil, errors.New("gmail: invalid user") } if config.Config["pass"] == "" { return nil, errors.New("gmail: invalid pass") } if config.Config["notification_addresses"] == "" { return nil, errors.New("gmail: invalid notification addresses") } return Notifier(Gmail{ name: config.Name, user: config.Config["user"], pass: config.Config["pass"], notificationAddresses: strings.Split(config.Config["notification_addresses"], ","), }), nil }
View Source
var NewSlackNotifier = func(config Config) (Notifier, error) { if config.Type != "slack" { return nil, errors.New("slack: invalid config type") } if config.Config["webhook_url"] == "" { return nil, errors.New("slack: invalid webhook_url") } return Notifier(SlackWebhook{ name: config.Name, url: config.Config["webhook_url"], channel: config.Config["channel"], username: config.Config["username"], iconEmoji: config.Config["icon_emoji"], }), nil }
View Source
var NewStandardError = func(config Config) (Notifier, error) { return Notifier(StandardError{ name: "stderr", log: log.New(os.Stderr, "", log.Ldate|log.Ltime), }), nil }
View Source
var NewTwilioNotifier = func(config Config) (Notifier, error) { if config.Type != "twilio" { return nil, errors.New("twilio: invalid config type") } if config.Config["account_sid"] == "" { return nil, errors.New("twilio: invalid account_sid") } if config.Config["auth_token"] == "" { return nil, errors.New("twilio: invalid auth_token") } if config.Config["twilio_number"] == "" { return nil, errors.New("twilio: invalid twilio_number") } if config.Config["notification_numbers"] == "" { return nil, errors.New("twilio: invalid notification_numbers") } return Notifier(Twilio{ accountSid: config.Config["account_sid"], authToken: config.Config["auth_token"], phoneNumbers: strings.Split(config.Config["notification_numbers"], ","), twilioNumber: config.Config["twilio_number"], }), nil }
Functions ¶
Types ¶
type SlackPayload ¶
type SlackWebhook ¶
type SlackWebhook struct {
// contains filtered or unexported fields
}
func (SlackWebhook) Name ¶
func (a SlackWebhook) Name() string
func (SlackWebhook) Notify ¶
func (a SlackWebhook) Notify(msg Message) error
type StandardError ¶
type StandardError struct {
// contains filtered or unexported fields
}
func (StandardError) Name ¶
func (a StandardError) Name() string
func (StandardError) Notify ¶
func (a StandardError) Notify(msg Message) error
Click to show internal directories.
Click to hide internal directories.