notification

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscordSender

func NewDiscordSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender

func NewNotifiarrSender

func NewNotifiarrSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender

func NewPushoverSender

func NewPushoverSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender

func NewTelegramSender

func NewTelegramSender(log zerolog.Logger, settings domain.Notification) domain.NotificationSender

Types

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 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"`
}

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