alert

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendByAppName

func SendByAppName(channel int, msg string)

通过应用名发送消息,自动获取应用名,不需要传递 0-没有渠道,1-企业微信,2-邮件,3-短信,4-企业微信+邮件,5-企业微信+短信,6-邮件+短信,7-企业微信+邮件+短信

func SendByCorpCodes

func SendByCorpCodes(channel int, msg string, corpCodes ...string)

通过工号发送消息 0-没有渠道,1-企业微信,2-邮件,3-短信,4-企业微信+邮件,5-企业微信+短信,6-邮件+短信,7-企业微信+邮件+短信

func SendByGroupId

func SendByGroupId(channel int, msg string, groupId int)

通过组发送消息 0-没有渠道,1-企业微信,2-邮件,3-短信,4-企业微信+邮件,5-企业微信+短信,6-邮件+短信,7-企业微信+邮件+短信

Types

type FrigateMessage

type FrigateMessage struct {
	//发送渠道,默认通过1为企业微信通知
	Channel int `json:"channel"`
	//消息标题
	Title string `json:"title"`
	//消息内容
	Content string `json:"content"`
	//当有异常堆栈时,堆栈内容
	Stack string `json:"stack"`
	//模块
	Module string `json:"module"`
	//标签
	Tags map[string]string `json:"tags"`

	// ------------------以下属于系统变量------------------------
	TraceId     string `json:"traceId"`
	HostIp      string `json:"hostIp"`
	AppName     string `json:"appName"`
	AppInstance string `json:"appInstance"`
	WorkEnv     string `json:"workEnv"`
	WorkIdc     string `json:"workIdc"`
	//发送时间
	Time   int64 `json:"time"`
	Format bool  `json:"format"`
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage() *FrigateMessage

func (*FrigateMessage) Send

func (m *FrigateMessage) Send()

Jump to

Keyboard shortcuts

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