notice

package
v0.0.0-...-6b69eb2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TELEGRAM   = "telegram"
	SLACK      = "slack"
	MSTEAM     = "msteam"
	LINE       = "line"
	LINENOTIFY = "line-notify"
	EMAIL      = "email"
	WEBHOOK    = "webhook"
	NATIVE     = "native"
)

Variables

This section is empty.

Functions

func HandlerNoticeMessage

func HandlerNoticeMessage(pgx *db.PGClient) func(*fiber.Ctx) error

func ProviderEmail

func ProviderEmail(c *fiber.Ctx, notice db.PGRow) (string, string, error)

func ProviderTelegram

func ProviderTelegram(c *fiber.Ctx, req *RequestNotice, notice db.PGRow) (string, string, error)

Types

type EmailProvider

type EmailProvider struct {
	Port int    `json:"port"`
	SMTP string `json:"smtp"`
	User string `json:"username"`
	Pass string `json:"password"`
}

type EmailRoom

type EmailRoom struct {
	To     string `json:"to"`
	From   string `json:"from"`
	Prefix string `json:"subject_prefix"`
}

type RequestNotice

type RequestNotice struct {
	Message string         `json:"message"`
	Sender  map[string]any `json:"sender,omitempty"`
}

type TelegramProvider

type TelegramProvider struct {
	Token string `json:"token"`
}

type TelegramRequest

type TelegramRequest struct {
	Mode string `json:"parse_mode"`
	Text string `json:"text"`
}

type TelegramResponse

type TelegramResponse struct {
	OK          bool   `json:"ok"`
	ErrorCode   int32  `json:"error_code,omitempty"`
	Description string `json:"description,omitempty"`
	Result      any    `json:"result"`
}

type TelegramRoom

type TelegramRoom struct {
	Mode   string `json:"mode"`
	Name   string `json:"name"`
	ChatId int64  `json:"chatId"`
}

Jump to

Keyboard shortcuts

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