MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / CreateTaskScanEmailAlertLog

Function CreateTaskScanEmailAlertLog

agent/utils/alert/alert.go:33–40  ·  view source on GitHub ↗
(alert dto.AlertDTO, create dto.AlertLogCreate, pushAlert dto.PushAlert, method string, transport *http.Transport, agentInfo *dto.AgentInfo, emailConfig model.AlertConfig)

Source from the content-addressed store, hash-verified

31var cronJobAlertTypes = []string{"shell", "app", "website", "database", "directory", "log", "snapshot", "curl", "cutWebsiteLog", "clean", "ntp"}
32
33func CreateTaskScanEmailAlertLog(alert dto.AlertDTO, create dto.AlertLogCreate, pushAlert dto.PushAlert, method string, transport *http.Transport, agentInfo *dto.AgentInfo, emailConfig model.AlertConfig) error {
34 params := CreateAlertParams(GetCronJobTypeName(pushAlert.Param))
35 alertDetail := ProcessAlertDetail(alert, pushAlert.TaskName, params, method)
36 alertRule := ProcessAlertRule(alert)
37 create.AlertRule = alertRule
38 create.AlertDetail = alertDetail
39 return CreateEmailAlertLog(create, alert, params, transport, agentInfo, emailConfig)
40}
41
42func CreateEmailAlertLog(create dto.AlertLogCreate, alert dto.AlertDTO, params []dto.Param, transport *http.Transport, agentInfo *dto.AgentInfo, emailConfig model.AlertConfig) error {
43 var alertLog model.AlertLog

Callers

nothing calls this directly

Calls 5

CreateAlertParamsFunction · 0.85
GetCronJobTypeNameFunction · 0.85
ProcessAlertDetailFunction · 0.85
ProcessAlertRuleFunction · 0.85
CreateEmailAlertLogFunction · 0.85

Tested by

no test coverage detected