notifier

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel interface {
	SendMessage(ctx context.Context, message string, enableNotification bool) error
}

func NewDiscordChannel

func NewDiscordChannel(
	webhookUrl string,
) Channel

func NewTelegramChannel

func NewTelegramChannel(
	chatId string,
	accessToken string,
) Channel

type DefaultService

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

func (*DefaultService) SendError

func (d *DefaultService) SendError(ctx context.Context, err error) error

func (*DefaultService) SendResults

func (d *DefaultService) SendResults(ctx context.Context, results []common.Job) error

type DiscordChannel

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

func (*DiscordChannel) SendMessage

func (d *DiscordChannel) SendMessage(ctx context.Context, message string, enableNotification bool) error

type NotificationInfo

type NotificationInfo struct {
	Template string
	Channels []Channel
}

type Service

type Service interface {
	SendResults(ctx context.Context, results []common.Job) error
	SendError(ctx context.Context, err error) error
}

type TelegramChannel

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

func (TelegramChannel) SendMessage

func (t TelegramChannel) SendMessage(ctx context.Context, message string, enableNotification bool) error

Jump to

Keyboard shortcuts

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