notification

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscordNotificationProvider

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

func NewDiscordNotificationProvider

func NewDiscordNotificationProvider(s storage.Storage) *DiscordNotificationProvider

func (*DiscordNotificationProvider) Send

func (p *DiscordNotificationProvider) Send(ctx context.Context, title, message string, wf storage.Workflow) error

func (*DiscordNotificationProvider) SetStorage

func (p *DiscordNotificationProvider) SetStorage(s storage.Storage)

func (*DiscordNotificationProvider) Type

type EmailNotificationProvider

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

func NewEmailNotificationProvider

func NewEmailNotificationProvider(s storage.Storage) *EmailNotificationProvider

func (*EmailNotificationProvider) Send

func (p *EmailNotificationProvider) Send(ctx context.Context, title, message string, wf storage.Workflow) error

func (*EmailNotificationProvider) SetStorage

func (p *EmailNotificationProvider) SetStorage(s storage.Storage)

func (*EmailNotificationProvider) Type

type GenericWebhookProvider

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

func NewGenericWebhookProvider

func NewGenericWebhookProvider(s storage.Storage) *GenericWebhookProvider

func (*GenericWebhookProvider) Send

func (p *GenericWebhookProvider) Send(ctx context.Context, title, message string, wf storage.Workflow) error

func (*GenericWebhookProvider) SetStorage

func (p *GenericWebhookProvider) SetStorage(s storage.Storage)

func (*GenericWebhookProvider) Type

func (p *GenericWebhookProvider) Type() string

type NotificationSettings

type NotificationSettings struct {
	SMTPHost     string `json:"smtp_host"`
	SMTPPort     int    `json:"smtp_port"`
	SMTPUser     string `json:"smtp_user"`
	SMTPPassword string `json:"smtp_password"`
	SMTPFrom     string `json:"smtp_from"`
	SMTPSSL      bool   `json:"smtp_ssl"`
	DefaultEmail string `json:"default_email"`

	TelegramToken  string `json:"telegram_token"`
	TelegramChatID string `json:"telegram_chat_id"`

	SlackWebhook   string `json:"slack_webhook"`
	DiscordWebhook string `json:"discord_webhook"`
	WebhookURL     string `json:"webhook_url"`
	BaseURL        string `json:"base_url"`
}

func (NotificationSettings) SendDiscord

func (ns NotificationSettings) SendDiscord(ctx context.Context, title, message string, wf storage.Workflow) error

func (NotificationSettings) SendEmail

func (ns NotificationSettings) SendEmail(ctx context.Context, title, message string, wf storage.Workflow) error

func (NotificationSettings) SendGenericWebhook

func (ns NotificationSettings) SendGenericWebhook(ctx context.Context, title, message string, wf storage.Workflow) error

func (NotificationSettings) SendSlack

func (ns NotificationSettings) SendSlack(ctx context.Context, title, message string, wf storage.Workflow) error

func (NotificationSettings) SendTelegram

func (ns NotificationSettings) SendTelegram(ctx context.Context, title, message string, wf storage.Workflow) error

func (NotificationSettings) Test

type Provider

type Provider interface {
	Send(ctx context.Context, title, message string, wf storage.Workflow) error
	Type() string
	SetStorage(s storage.Storage)
}

type Service

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

func NewService

func NewService(s storage.Storage) *Service

func (*Service) AddProvider

func (s *Service) AddProvider(p Provider)

func (*Service) Notify

func (s *Service) Notify(ctx context.Context, title, message string, wf storage.Workflow)

func (*Service) SetStorage

func (s *Service) SetStorage(s2 storage.Storage)

type SlackNotificationProvider

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

func NewSlackNotificationProvider

func NewSlackNotificationProvider(s storage.Storage) *SlackNotificationProvider

func (*SlackNotificationProvider) Send

func (p *SlackNotificationProvider) Send(ctx context.Context, title, message string, wf storage.Workflow) error

func (*SlackNotificationProvider) SetStorage

func (p *SlackNotificationProvider) SetStorage(s storage.Storage)

func (*SlackNotificationProvider) Type

type TelegramNotificationProvider

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

func NewTelegramNotificationProvider

func NewTelegramNotificationProvider(s storage.Storage) *TelegramNotificationProvider

func (*TelegramNotificationProvider) Send

func (p *TelegramNotificationProvider) Send(ctx context.Context, title, message string, wf storage.Workflow) error

func (*TelegramNotificationProvider) SetStorage

func (p *TelegramNotificationProvider) SetStorage(s storage.Storage)

func (*TelegramNotificationProvider) Type

type TestResult

type TestResult struct {
	Channel string `json:"channel"`
	Status  string `json:"status"` // ok | skipped | error
	Error   string `json:"error,omitempty"`
}

type UINotificationProvider

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

func NewUINotificationProvider

func NewUINotificationProvider(s storage.Storage) *UINotificationProvider

func (*UINotificationProvider) Send

func (p *UINotificationProvider) Send(ctx context.Context, title, message string, wf storage.Workflow) error

func (*UINotificationProvider) SetStorage

func (p *UINotificationProvider) SetStorage(s storage.Storage)

func (*UINotificationProvider) Type

func (p *UINotificationProvider) Type() string

Jump to

Keyboard shortcuts

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