Documentation
¶
Index ¶
- Constants
- func GetTheme() string
- func SendIMNotification(ch *models.NotificationChannelV2, title, content string) error
- func SendMail(s *models.NotificationSettingV2, ch *models.NotificationChannelV2, ...) error
- type GmailOAuth2Auth
- type ResBody
- type ServiceV2
- func (svc *ServiceV2) Send(s *models.NotificationSettingV2, args ...any)
- func (svc *ServiceV2) SendIM(s *models.NotificationSettingV2, ch *models.NotificationChannelV2, ...)
- func (svc *ServiceV2) SendMail(s *models.NotificationSettingV2, ch *models.NotificationChannelV2, ...)
- func (svc *ServiceV2) SendNodeNotification(node *models.NodeV2)
- type VariableData
Constants ¶
View Source
const ( TypeMail = "mail" TypeIM = "im" )
View Source
const ( ChannelMailProviderGmail = "gmail" ChannelMailProviderOutlook = "outlook" ChannelMailProviderYahoo = "yahoo" ChannelMailProviderICloud = "icloud" ChannelMailProviderAol = "aol" ChannelMailProviderZoho = "zoho" ChannelMailProviderQQ = "qq" ChannelMailProvider163 = "163" ChannelMailProviderExmail = "exmail" ChannelIMProviderSlack = "slack" // https://api.slack.com/messaging/webhooks ChannelIMProviderTelegram = "telegram" // https://core.telegram.org/bots/api ChannelIMProviderDiscord = "discord" // https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks ChannelIMProviderMSTeams = "ms_teams" // https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook?tabs=newteams%2Cjavascript ChannelIMProviderWechatWork = "wechat_work" // https://developer.work.weixin.qq.com/document/path/91770 ChannelIMProviderDingtalk = "dingtalk" // https://open.dingtalk.com/document/orgapp/custom-robot-access ChannelIMProviderLark = "lark" // https://www.larksuite.com/hc/en-US/articles/099698615114-use-webhook-triggers )
View Source
const ( StatusSending = "sending" StatusSuccess = "success" StatusError = "error" )
Variables ¶
This section is empty.
Functions ¶
func SendIMNotification ¶
Types ¶
type GmailOAuth2Auth ¶
type GmailOAuth2Auth struct {
// contains filtered or unexported fields
}
GmailOAuth2Auth 自定义OAuth2认证
func (*GmailOAuth2Auth) Start ¶
func (a *GmailOAuth2Auth) Start(_ *smtp.ServerInfo) (string, []byte, error)
type ServiceV2 ¶
type ServiceV2 struct { }
func GetNotificationServiceV2 ¶
func GetNotificationServiceV2() *ServiceV2
func (*ServiceV2) SendNodeNotification ¶
func (svc *ServiceV2) SendNodeNotification(node *models.NodeV2)
type VariableData ¶
type VariableData struct { Task *models.TaskV2 `json:"task"` TaskStat *models.TaskStatV2 `json:"task_stat"` Spider *models.SpiderV2 `json:"spider"` Node *models.NodeV2 `json:"node"` Schedule *models.ScheduleV2 `json:"schedule"` Alert *models.NotificationAlertV2 `json:"alert"` Metric *models.MetricV2 `json:"metric"` }
Click to show internal directories.
Click to hide internal directories.