pusher

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package pusher @Author arthur 15:52:00

Index

Constants

View Source
const (
	COLOR      = "#8b0000"
	SUBNAME    = "alarm"
	AUTHORLINK = ""
	ICON       = "https://avatars.githubusercontent.com/u/104639309?s=200&v=4"
	FOOTER     = "clickvisual"
)

Variables

This section is empty.

Functions

func BuildAlarmMsg

func BuildAlarmMsg(notification db.Notification, table *db.BaseTable, alarm *db.Alarm, filter *db.AlarmFilter, partialLog string) (msg *db.PushMsg, err error)

BuildAlarmMsg Description: 提供一个通用的md模式的获取内容的方法 param notification 通知的部分方法 param alarm 警告的数据库连接 param oneTheLogs 日志内容

func BuildAlarmMsgWithAt added in v1.0.0

func BuildAlarmMsgWithAt(notification db.Notification, table *db.BaseTable, alarm *db.Alarm, filter *db.AlarmFilter, partialLog string) (msg *db.PushMsg, err error)

BuildAlarmMsgWithAt Description: 提供一个通用的md模式的获取内容的方法 param notification 通知的部分方法 param alarm 警告的数据库连接 param oneTheLogs 日志内容

func Execute

func Execute(channelIds []int, pushMsg *db.PushMsg, pushMsgWithAt *db.PushMsg) error

Types

type DingDing

type DingDing struct{}

func (*DingDing) Send

func (d *DingDing) Send(channel *db.AlarmChannel, msg *db.PushMsg) (err error)

type FeiShu

type FeiShu struct{}

func (*FeiShu) Send

func (s *FeiShu) Send(channel *db.AlarmChannel, msg *db.PushMsg) (err error)

type IPusher

type IPusher interface {
	Send(*db.AlarmChannel, *db.PushMsg) error
}

func GetPusher

func GetPusher(typ int) (IPusher, error)

type MentionedOption

type MentionedOption struct {
	// contains filtered or unexported fields
}

func NewEmptyOption

func NewEmptyOption() *MentionedOption

func NewMentionAllOption

func NewMentionAllOption() *MentionedOption

func NewMentionMobileOption

func NewMentionMobileOption(mobileList ...string) *MentionedOption

type Slack

type Slack struct{}

func (*Slack) Send

func (s *Slack) Send(channel *db.AlarmChannel, msg *db.PushMsg) (err error)

type Telegram

type Telegram struct{}

func (*Telegram) Send

func (t *Telegram) Send(channel *db.AlarmChannel, msg *db.PushMsg) (err error)

type TelegramBot

type TelegramBot struct {
	// contains filtered or unexported fields
}

func NewTelegram

func NewTelegram(token string) (*TelegramBot, error)

func (*TelegramBot) SendFile

func (tg *TelegramBot) SendFile(filePath, fileName, mime, caption string, to int64) error

func (*TelegramBot) SendMessage

func (tg *TelegramBot) SendMessage(msg string, to int64, markdown bool) error

type WeChat

type WeChat struct{}

func (*WeChat) Send

func (d *WeChat) Send(channel *db.AlarmChannel, msg *db.PushMsg) (err error)

Send ... oneTheLogs one of the logs, detail info

type Webhook added in v1.0.0

type Webhook struct{}

func (*Webhook) Send added in v1.0.0

func (e *Webhook) Send(channel *db.AlarmChannel, msg *db.PushMsg) (err error)

Directories

Path Synopsis
Package feishu @Author arthur 09:51:00
Package feishu @Author arthur 09:51:00

Jump to

Keyboard shortcuts

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