notify

package
v0.0.0-...-514fb8c Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailNotifier

type EmailNotifier struct {
	Settings *EmailSettings
	// contains filtered or unexported fields
}

func (*EmailNotifier) Initialize

func (e *EmailNotifier) Initialize()

func (*EmailNotifier) Notify

func (e *EmailNotifier) Notify(text string) error

func (*EmailNotifier) String

func (e *EmailNotifier) String() string

type EmailSettings

type EmailSettings struct {
	SMTP     string
	Port     int
	Username string
	Password string
	From     string
	To       []string
}

func (*EmailSettings) Validate

func (es *EmailSettings) Validate() error

type Initializer

type Initializer interface {
	Initialize()
}

Initializer is used to initialize something

type Notifier

type Notifier interface {
	// Notify sends text over notifier, returns error message if failed
	Notify(text string) error
}

Notifier is used to send messages

type Notifiers

type Notifiers []Notifier

func (Notifiers) NotifyAll

func (notifiers Notifiers) NotifyAll(text string)

type PushoverNotifier

type PushoverNotifier struct {
	Settings *PushoverSettings
}

func (*PushoverNotifier) Initialize

func (e *PushoverNotifier) Initialize()

func (*PushoverNotifier) Notify

func (s *PushoverNotifier) Notify(text string) error

func (*PushoverNotifier) String

func (t *PushoverNotifier) String() string

type PushoverSettings

type PushoverSettings struct {
	UserKey  string `json:"userKey"`
	AppToken string `json:"appToken"`
}

func (*PushoverSettings) Validate

func (ts *PushoverSettings) Validate() error

type SlackNotifier

type SlackNotifier struct {
	Settings *SlackSettings
}

func (*SlackNotifier) Initialize

func (s *SlackNotifier) Initialize()

func (*SlackNotifier) Notify

func (s *SlackNotifier) Notify(text string) error

func (*SlackNotifier) String

func (s *SlackNotifier) String() string

type SlackSettings

type SlackSettings struct {
	BearerToken string `json:"bearerToken"`
	ChannelID   string `json:"channelId"`
}

func (*SlackSettings) Validate

func (ss *SlackSettings) Validate() error

type SmsNotifier

type SmsNotifier struct {
	Settings *SmsSettings
}

func (*SmsNotifier) Notify

func (s *SmsNotifier) Notify(text string) error

func (*SmsNotifier) String

func (s *SmsNotifier) String() string

type SmsSettings

type SmsSettings struct {
	Sms string `json:"sms"`
}

func (*SmsSettings) Validate

func (ss *SmsSettings) Validate() error

type TelegramNotifier

type TelegramNotifier struct {
	Settings *TelegramSettings
}

func (*TelegramNotifier) Initialize

func (e *TelegramNotifier) Initialize()

func (*TelegramNotifier) Notify

func (s *TelegramNotifier) Notify(text string) error

func (*TelegramNotifier) String

func (t *TelegramNotifier) String() string

type TelegramSettings

type TelegramSettings struct {
	BotToken string `json:"botToken"`
	ChatID   string `json:"chatId"`
}

func (*TelegramSettings) Validate

func (ts *TelegramSettings) Validate() error

type WebhookNotifier

type WebhookNotifier struct {
	Settings *WebhookSettings
}

func (*WebhookNotifier) Initialize

func (w *WebhookNotifier) Initialize()

func (*WebhookNotifier) Notify

func (w *WebhookNotifier) Notify(srv string) error

func (*WebhookNotifier) String

func (w *WebhookNotifier) String() string

type WebhookSettings

type WebhookSettings struct {
	Url    string `json:"url"`
	Method string `json:"method"`
}

func (*WebhookSettings) Validate

func (ws *WebhookSettings) Validate() error

Jump to

Keyboard shortcuts

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