Documentation ¶
Index ¶
- func DingDingDisturbSpecifiedStaff(ctx context.Context, req SendDingReportReq) error
- func SendDingRobot(url string, content string, isAtAll bool) error
- func SendDingRobotMD(url string, title, text string, isAtAll bool, atMobiles ...string) error
- type DingResponse
- type FeishuHooker
- type Hooker
- type Option
- type RichContent
- type RichContentItem
- type SendDingReportReq
- type SupportHookType
- type TextMessage
- type TextParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DingDingDisturbSpecifiedStaff ¶
func DingDingDisturbSpecifiedStaff(ctx context.Context, req SendDingReportReq) error
钉钉告警
Types ¶
type DingResponse ¶
type FeishuHooker ¶
type FeishuHooker struct {
// contains filtered or unexported fields
}
func NewFeishuHooker ¶
func NewFeishuHooker(url string, opts ...Option) *FeishuHooker
func (*FeishuHooker) GenSign ¶
func (f *FeishuHooker) GenSign(secret string, timestamp string) (string, error)
func (*FeishuHooker) SendRichTextMsg ¶
func (f *FeishuHooker) SendRichTextMsg(content RichContent) error
func (*FeishuHooker) SendTextMsg ¶
func (f *FeishuHooker) SendTextMsg(content string) error
type Hooker ¶
type Hooker interface { SendTextMsg(content string) error SendRichTextMsg(content RichContent) error // contains filtered or unexported methods }
type RichContent ¶
type RichContent struct { Title string `json:"title"` Content [][]RichContentItem `json:"content"` }
type RichContentItem ¶
type SendDingReportReq ¶
type SupportHookType ¶
type SupportHookType int8
const ( Feishu SupportHookType = 1 DingDing SupportHookType = 2 )
type TextMessage ¶
type TextMessage struct { MsgType string `json:"msgtype"` Text TextParams `json:"text"` At struct { AtMobiles []string `json:"atMobiles"` IsAtAll bool `json:"isAtAll"` } `json:"at"` }
TextMessage 发送钉钉消息
type TextParams ¶
type TextParams struct {
Content string `json:"content"`
}
Click to show internal directories.
Click to hide internal directories.