alert

package
v0.0.0-...-2db71d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

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
}

func (AlertClient) SendUserAlert

func (client AlertClient) SendUserAlert() error

func (AlertClient) SendUserAlertSync

func (client AlertClient) SendUserAlertSync() error

type BaseResp

type BaseResp struct {
	RetCode uint32 `json:"retcode"`
	RetMsg  string `json:"retmsg"`
}

type ErrCode

type ErrCode uint32
const (
	ErrCodeOK ErrCode = 0
)

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL