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

Function ProcessAlertDetail

agent/utils/alert/alert.go:160–175  ·  view source on GitHub ↗
(alert dto.AlertDTO, project string, params []dto.Param, method string)

Source from the content-addressed store, hash-verified

158}
159
160func ProcessAlertDetail(alert dto.AlertDTO, project string, params []dto.Param, method string) string {
161 alertDetail := dto.AlertDetail{
162 Type: GetCronJobType(alert.Type),
163 SubType: alert.Type,
164 Title: alert.Title,
165 Method: method,
166 Project: project,
167 Params: params,
168 }
169 marshal, err := json.Marshal(alertDetail)
170 if err != nil {
171 global.LOG.Errorf("error processing alert detail, err: %v", err)
172 return ""
173 }
174 return string(marshal)
175}
176
177func ProcessAlertRule(alert dto.AlertDTO) string {
178 marshal, err := json.Marshal(alert)

Callers 1

Calls 1

GetCronJobTypeFunction · 0.85

Tested by

no test coverage detected