Documentation
¶
Index ¶
- type NotificationSender
- type NotificationService
- func (s *NotificationService) Notify(notifierID string, title string, message string, errorOccurred bool) bool
- func (s *NotificationService) NotifyToDefault(message string) bool
- func (s *NotificationService) NotifyWithErrorToDefault(message string) bool
- func (s *NotificationService) NotifyWithTaskContext(notifierID string, message string, taskCtx task.TaskContext) bool
- func (s *NotificationService) Run(serviceStopCtx context.Context, serviceStopWaiter *sync.WaitGroup) error
- func (s *NotificationService) SetNewNotifier(...)
- func (s *NotificationService) SupportHTMLMessage(notifierID string) bool
- type NotifierHandler
- type NotifierID
- type TelegramBot
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) 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) 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.
Click to show internal directories.
Click to hide internal directories.