notification

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationSender

type NotificationSender interface {
	Notify(notifierID string, title string, message string, errorOccurred bool) bool
	NotifyToDefault(message string) bool
	NotifyWithErrorToDefault(message string) bool
}

NotificationSender

type NotificationService

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

NotificationService

func NewService

func NewService(appConfig *config.AppConfig, taskRunner task.TaskRunner) *NotificationService

func (*NotificationService) Notify

func (s *NotificationService) Notify(notifierID string, title string, message string, errorOccurred bool) bool

func (*NotificationService) NotifyToDefault

func (s *NotificationService) NotifyToDefault(message string) bool

func (*NotificationService) NotifyWithErrorToDefault

func (s *NotificationService) NotifyWithErrorToDefault(message string) bool

func (*NotificationService) NotifyWithTaskContext

func (s *NotificationService) NotifyWithTaskContext(notifierID string, message string, taskCtx task.TaskContext) bool

func (*NotificationService) Run

func (s *NotificationService) Run(serviceStopCtx context.Context, serviceStopWaiter *sync.WaitGroup) error

func (*NotificationService) SetNewNotifier added in v1.0.0

func (s *NotificationService) SetNewNotifier(newNotifierFn func(id NotifierID, botToken string, chatID int64, appConfig *config.AppConfig) NotifierHandler)

func (*NotificationService) SupportHTMLMessage

func (s *NotificationService) SupportHTMLMessage(notifierID string) bool

type NotifierHandler added in v1.0.0

type NotifierHandler interface {
	ID() NotifierID

	Notify(message string, taskCtx task.TaskContext) (succeeded bool)

	Run(taskRunner task.TaskRunner, notificationStopCtx context.Context, notificationStopWaiter *sync.WaitGroup)

	SupportHTMLMessage() bool
}

type NotifierID

type NotifierID string

type TelegramBot added in v1.0.0

type TelegramBot interface {
	GetUpdatesChan(config tgbotapi.UpdateConfig) tgbotapi.UpdatesChannel
	Send(c tgbotapi.Chattable) (tgbotapi.Message, error)
	StopReceivingUpdates()
	GetSelf() tgbotapi.User
}

TelegramBot defines the interface for interacting with the Telegram Bot API. This allows for mocking in tests.

Jump to

Keyboard shortcuts

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