Documentation
¶
Index ¶
Constants ¶
View Source
const ( USER_ALERT_LEVEL_INFO = "info" USER_ALERT_LEVEL_WARN = "warning" USER_ALERT_URI = "/cm-alert-api/v1/alert/user" )
用户警告的默认配置
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertClient ¶
type AlertClient struct {
// contains filtered or unexported fields
}
AlertClient 发送警告的客户端
func (AlertClient) SendUserAlert ¶
func (client AlertClient) SendUserAlert() error
SendUserAlert 发送警告给用户(异步) @return error
func (AlertClient) SendUserAlertSync ¶
func (client AlertClient) SendUserAlertSync() error
SendUserAlertSync 发送警告给用户并等待http响应结果 @return error
type BaseResp ¶
BaseResp 响应对象
type UserAlertModel ¶
type UserAlertModel struct {
// (1)必填字段
// 告警级别,支持:USER_ALERT_LEVEL_INFO、USER_ALERT_LEVEL_WARN
// 仅部分告警触达方式下有效
Level string `json:"level"`
// 告警标题
Subject string `json:"subject"`
// 告警内容
Content string `json:"content"`
// (2)选填字段
// 告警邮件接收者邮箱,设置该字段后,将发送邮件
Receivers []string `json:"receivers"`
// 告警webhooks,当前仅支持企业微信群,设置该字段,将发送到指定企业微信群
Webhooks []string `json:"webhooks"`
// 附件名(邮件)
AttachName string `json:"attach_name"`
// 附件base64编码内容(邮件),大小限制在配置文件attach_file_size指定
AttachFile string `json:"attach_file"`
}
UserAlertModel 用户警告对象
Source Files
¶
- sdk_alert.go
Click to show internal directories.
Click to hide internal directories.