Documentation ¶
Index ¶
- func BuildTplMessage(tpl *template.Template, event *models.AlertCurEvent) string
- func MapStrToStr(arr []string, fn func(s string) string) []string
- func MayPluginNotify(noticeBytes []byte)
- func PublishToRedis(clusterName string, bs []byte)
- func SendCallbacks(urls []string, event *models.AlertCurEvent)
- func SendEmail(subject, content string, tos []string)
- func SendMM(message MatterMostMessage)
- func SendTelegram(message TelegramMessage)
- func SendWebhooks(webhooks []config.Webhook, event *models.AlertCurEvent)
- func StartEmailSender()
- func WriteEmail(subject, content string, tos []string)
- type Cards
- type Conf
- type DingtalkSender
- type Element
- type EmailSender
- type FeishuCardSender
- type FeishuSender
- type Headers
- type MatterMostMessage
- type MessageContext
- type MmSender
- type Sender
- type TaskCreateReply
- type TaskForm
- type Te
- type TelegramMessage
- type TelegramSender
- type Titles
- type WecomSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTplMessage ¶ added in v5.15.0
func BuildTplMessage(tpl *template.Template, event *models.AlertCurEvent) string
func MapStrToStr ¶ added in v5.11.2
func MayPluginNotify ¶ added in v5.15.0
func MayPluginNotify(noticeBytes []byte)
func PublishToRedis ¶ added in v5.15.0
func SendCallbacks ¶ added in v5.15.0
func SendCallbacks(urls []string, event *models.AlertCurEvent)
func SendMM ¶ added in v5.11.2
func SendMM(message MatterMostMessage)
func SendTelegram ¶ added in v5.14.3
func SendTelegram(message TelegramMessage)
func SendWebhooks ¶ added in v5.15.0
func SendWebhooks(webhooks []config.Webhook, event *models.AlertCurEvent)
func StartEmailSender ¶
func StartEmailSender()
func WriteEmail ¶
Types ¶
type DingtalkSender ¶ added in v5.15.0
type DingtalkSender struct {
// contains filtered or unexported fields
}
func (*DingtalkSender) Send ¶ added in v5.15.0
func (ds *DingtalkSender) Send(ctx MessageContext)
type EmailSender ¶ added in v5.15.0
type EmailSender struct {
// contains filtered or unexported fields
}
func (*EmailSender) Send ¶ added in v5.15.0
func (es *EmailSender) Send(ctx MessageContext)
type FeishuCardSender ¶ added in v5.15.1
type FeishuCardSender struct {
// contains filtered or unexported fields
}
func (*FeishuCardSender) Send ¶ added in v5.15.1
func (fs *FeishuCardSender) Send(ctx MessageContext)
type FeishuSender ¶ added in v5.15.0
type FeishuSender struct {
// contains filtered or unexported fields
}
func (*FeishuSender) Send ¶ added in v5.15.0
func (fs *FeishuSender) Send(ctx MessageContext)
type MatterMostMessage ¶ added in v5.11.2
type MessageContext ¶ added in v5.15.0
type MessageContext struct { Users []*models.User Rule *models.AlertRule Event *models.AlertCurEvent }
MessageContext 一个event所生成的告警通知的上下文
func BuildMessageContext ¶ added in v5.15.0
func BuildMessageContext(rule *models.AlertRule, event *models.AlertCurEvent, uids []int64) MessageContext
type MmSender ¶ added in v5.15.0
type MmSender struct {
// contains filtered or unexported fields
}
func (*MmSender) Send ¶ added in v5.15.0
func (ms *MmSender) Send(ctx MessageContext)
type Sender ¶ added in v5.15.0
type Sender interface { Send(ctx MessageContext) // SendRaw 发送原始消息,目前在notifyMaintainer时使用 SendRaw(users []*models.User, title, message string) }
Sender 发送消息通知的接口
type TaskCreateReply ¶ added in v5.15.0
type TaskForm ¶ added in v5.15.0
type TaskForm struct { Title string `json:"title"` Account string `json:"account"` Batch int `json:"batch"` Tolerance int `json:"tolerance"` Timeout int `json:"timeout"` Pause string `json:"pause"` Script string `json:"script"` Args string `json:"args"` Action string `json:"action"` Creator string `json:"creator"` Hosts []string `json:"hosts"` }
type TelegramMessage ¶ added in v5.14.3
type TelegramSender ¶ added in v5.15.0
type TelegramSender struct {
// contains filtered or unexported fields
}
func (*TelegramSender) Send ¶ added in v5.15.0
func (ts *TelegramSender) Send(ctx MessageContext)
type WecomSender ¶ added in v5.15.0
type WecomSender struct {
// contains filtered or unexported fields
}
func (*WecomSender) Send ¶ added in v5.15.0
func (ws *WecomSender) Send(ctx MessageContext)
Click to show internal directories.
Click to hide internal directories.