notification

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

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 ConditionMessagePart struct {
	Condition bool
	Format    string
	Bits      []interface{}
}

type DiscordEmbeds

type DiscordEmbeds struct {
	Title       string                `json:"title"`
	Description string                `json:"description"`
	Color       int                   `json:"color"`
	Fields      []DiscordEmbedsFields `json:"fields,omitempty"`
	Timestamp   time.Time             `json:"timestamp"`
}

type DiscordEmbedsFields

type DiscordEmbedsFields struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline,omitempty"`
}

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 LunaSeaMessage struct {
	Title string `json:"title"`
	Body  string `json:"body"`
	Image string `json:"image,omitempty"`
}

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

BuildBody constructs the body of the notification message.

type Service

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

Jump to

Keyboard shortcuts

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