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, notifyScript models.NotifyScript)
- func RestartEmailSender(smtp aconf.SMTPConfig)
- func SendCallbacks(ctx *ctx.Context, urls []string, event *models.AlertCurEvent, ...)
- func SendMM(message MatterMostMessage)
- func SendTelegram(message TelegramMessage)
- func SendWebhooks(webhooks []*models.Webhook, event *models.AlertCurEvent)
- func StartEmailSender(smtp aconf.SMTPConfig)
- type DingtalkSender
- type EmailSender
- type FeishuSender
- type MatterMostMessage
- type MessageContext
- type MmSender
- type Sender
- type TaskCreateReply
- type TaskForm
- type TelegramMessage
- type TelegramSender
- type WecomSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTplMessage ¶
func BuildTplMessage(tpl *template.Template, event *models.AlertCurEvent) string
func MayPluginNotify ¶
func MayPluginNotify(noticeBytes []byte, notifyScript models.NotifyScript)
func RestartEmailSender ¶
func RestartEmailSender(smtp aconf.SMTPConfig)
func SendCallbacks ¶
func SendCallbacks(ctx *ctx.Context, urls []string, event *models.AlertCurEvent, targetCache *memsto.TargetCacheType, ibexConf aconf.Ibex)
func SendMM ¶
func SendMM(message MatterMostMessage)
func SendTelegram ¶
func SendTelegram(message TelegramMessage)
func SendWebhooks ¶
func SendWebhooks(webhooks []*models.Webhook, event *models.AlertCurEvent)
func StartEmailSender ¶
func StartEmailSender(smtp aconf.SMTPConfig)
Types ¶
type DingtalkSender ¶
type DingtalkSender struct {
// contains filtered or unexported fields
}
func (*DingtalkSender) Send ¶
func (ds *DingtalkSender) Send(ctx MessageContext)
type EmailSender ¶
type EmailSender struct {
// contains filtered or unexported fields
}
func (*EmailSender) Send ¶
func (es *EmailSender) Send(ctx MessageContext)
func (*EmailSender) SendEmail ¶
func (es *EmailSender) SendEmail(subject, content string, tos []string, stmp aconf.SMTPConfig)
func (*EmailSender) WriteEmail ¶
func (es *EmailSender) WriteEmail(subject, content string, tos []string)
type FeishuSender ¶
type FeishuSender struct {
// contains filtered or unexported fields
}
func (*FeishuSender) Send ¶
func (fs *FeishuSender) Send(ctx MessageContext)
type MatterMostMessage ¶
type MessageContext ¶
type MessageContext struct { Users []*models.User Rule *models.AlertRule Event *models.AlertCurEvent }
MessageContext 一个event所生成的告警通知的上下文
func BuildMessageContext ¶
func BuildMessageContext(rule *models.AlertRule, event *models.AlertCurEvent, uids []int64, userCache *memsto.UserCacheType) MessageContext
type MmSender ¶
type MmSender struct {
// contains filtered or unexported fields
}
func (*MmSender) Send ¶
func (ms *MmSender) Send(ctx MessageContext)
type TaskCreateReply ¶
type TaskForm ¶
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 ¶
type TelegramSender ¶
type TelegramSender struct {
// contains filtered or unexported fields
}
func (*TelegramSender) Send ¶
func (ts *TelegramSender) Send(ctx MessageContext)
type WecomSender ¶
type WecomSender struct {
// contains filtered or unexported fields
}
func (*WecomSender) Send ¶
func (ws *WecomSender) Send(ctx MessageContext)
Click to show internal directories.
Click to hide internal directories.