notify

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled(cfg Config) bool

func SendAll

func SendAll(nn []Notifier, title, message string) []error

Types

type Config

type Config struct {
	SlackWebhook   string
	DiscordWebhook string
	TelegramToken  string
	TelegramChatID string
	SMTPHost       string
	SMTPPort       int
	SMTPUser       string
	SMTPPass       string
	SMTPFrom       string
	SMTPTo         []string
	WebhookURL     string
}

type Discord

type Discord struct {
	// contains filtered or unexported fields
}

func NewDiscord

func NewDiscord(webhookURL string) *Discord

func (*Discord) Send

func (d *Discord) Send(title, message string) error

type Notifier

type Notifier interface {
	Send(title, message string) error
}

func BuildNotifiers

func BuildNotifiers(cfg Config) []Notifier

type SMTP

type SMTP struct {
	// contains filtered or unexported fields
}

func NewSMTP

func NewSMTP(host string, port int, user, pass, from string, to []string) *SMTP

func (*SMTP) Send

func (s *SMTP) Send(title, message string) error

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

func NewSlack

func NewSlack(webhookURL string) *Slack

func (*Slack) Send

func (s *Slack) Send(title, message string) error

type Telegram

type Telegram struct {
	// contains filtered or unexported fields
}

func NewTelegram

func NewTelegram(token, chatID string) *Telegram

func (*Telegram) Send

func (t *Telegram) Send(title, message string) error

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

func NewWebhook

func NewWebhook(url string) *Webhook

func (*Webhook) Send

func (w *Webhook) Send(title, message string) error

Jump to

Keyboard shortcuts

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