Documentation ¶
Index ¶
- func BuildTitle(event domain.NotificationEvent) string
- func NewDiscordSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
- func NewGotifySender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
- func NewLunaSeaSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
- func NewNotifiarrSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
- func NewNtfySender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
- func NewPushoverSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
- func NewShoutrrrSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
- func NewTelegramSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
- type ConditionMessagePart
- type DiscordEmbeds
- type DiscordEmbedsFields
- type DiscordMessage
- type EmbedColors
- type LunaSeaMessage
- type MessageBuilder
- type MessageBuilderHTML
- type MessageBuilderPlainText
- type Service
- type TelegramMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTitle ¶ added in v1.36.0
func BuildTitle(event domain.NotificationEvent) string
BuildTitle constructs the title of the notification message.
func NewDiscordSender ¶
func NewDiscordSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
func NewGotifySender ¶ added in v1.32.0
func NewGotifySender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
func NewLunaSeaSender ¶ added in v1.35.0
func NewLunaSeaSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
func NewNotifiarrSender ¶
func NewNotifiarrSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
func NewNtfySender ¶ added in v1.35.0
func NewNtfySender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
func NewPushoverSender ¶
func NewPushoverSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
func NewShoutrrrSender ¶ added in v1.35.0
func NewShoutrrrSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
func NewTelegramSender ¶
func NewTelegramSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender
Types ¶
type ConditionMessagePart ¶ added in v1.36.0
type DiscordEmbeds ¶
type DiscordEmbedsFields ¶
type DiscordMessage ¶
type DiscordMessage struct { Content interface{} `json:"content"` Embeds []DiscordEmbeds `json:"embeds,omitempty"` }
type EmbedColors ¶
type EmbedColors int
const ( LIGHT_BLUE EmbedColors = 5814783 // 58b9ff RED EmbedColors = 15548997 // ed4245 GREEN EmbedColors = 5763719 // 57f287 GRAY EmbedColors = 10070709 // 99aab5 )
type LunaSeaMessage ¶ added in v1.35.0
type MessageBuilder ¶ added in v1.36.0
type MessageBuilder interface {
BuildBody(payload domain.NotificationPayload) string
}
type MessageBuilderHTML ¶ added in v1.36.0
type MessageBuilderHTML struct{}
MessageBuilderHTML constructs the body of the notification message in HTML format.
func (*MessageBuilderHTML) BuildBody ¶ added in v1.36.0
func (b *MessageBuilderHTML) BuildBody(payload domain.NotificationPayload) string
type MessageBuilderPlainText ¶ added in v1.36.0
type MessageBuilderPlainText struct{}
MessageBuilderPlainText constructs the body of the notification message in plain text format.
func (*MessageBuilderPlainText) BuildBody ¶ added in v1.36.0
func (b *MessageBuilderPlainText) BuildBody(payload domain.NotificationPayload) string
BuildBody constructs the body of the notification message.
type Service ¶
type Service interface { Find(ctx context.Context, params domain.NotificationQueryParams) ([]domain.Notification, int, error) FindByID(ctx context.Context, id int) (*domain.Notification, error) Store(ctx context.Context, n domain.Notification) (*domain.Notification, error) Update(ctx context.Context, n domain.Notification) (*domain.Notification, error) Delete(ctx context.Context, id int) error Send(event domain.NotificationEvent, payload domain.NotificationPayload) Test(ctx context.Context, notification domain.Notification) error }
func NewService ¶
func NewService(log logger.Logger, repo domain.NotificationRepo) Service
type TelegramMessage ¶
type TelegramMessage struct { ChatID string `json:"chat_id"` Text string `json:"text"` ParseMode string `json:"parse_mode"` MessageThreadID int `json:"message_thread_id,omitempty"` }
TelegramMessage Reference: https://core.telegram.org/bots/api#sendmessage
Click to show internal directories.
Click to hide internal directories.