Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Option
- type Output
- type WXAlarm
- func (w *WXAlarm) SendMarkdownMessage(ctx context.Context, message string) (*Output, error)
- func (w *WXAlarm) SendMarkdownMessageWithRetry(ctx context.Context, message string) (output *Output, err error)
- func (w *WXAlarm) SendMessage(ctx context.Context, message string) (*Output, error)
- func (w *WXAlarm) SendTextMessage(ctx context.Context, message string, ...) (*Output, error)
- func (w *WXAlarm) SendTextMessageWithRetry(ctx context.Context, message string, ...) (output *Output, err error)
Constants ¶
View Source
const ( WxHookKey = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send" WxErrCodeFreqLimit = 45009 )
Variables ¶
View Source
var (
AlarmTemplate = `
异常消息:
- 环境: %s
- 服务名称: %s
- 消息IP: %s
- 消息时间: %s
- 提示: %s
- 错误信息: %v`
)
Functions ¶
This section is empty.
Types ¶
type WXAlarm ¶
type WXAlarm struct {
// contains filtered or unexported fields
}
func (*WXAlarm) SendMarkdownMessage ¶
发送markdown形式消息
func (*WXAlarm) SendMarkdownMessageWithRetry ¶
func (w *WXAlarm) SendMarkdownMessageWithRetry(ctx context.Context, message string) (output *Output, err error)
发送失败进行重试,只限于网络报错或者频率限制错误进行重试 谨慎使用,该函数会阻塞调用
func (*WXAlarm) SendMessage ¶
Click to show internal directories.
Click to hide internal directories.