Documentation ¶
Index ¶
- Constants
- Variables
- func InitDingTalk(c config.Conf) error
- func SendLarkMsg(msg string) string
- func SendMarkdownMessage(accessToken string, title string, text string, isAtAll bool, ...) string
- func SendMarkdownMsg(key string, msg string) string
- func SendMsg(key string, msg string, atList []string, mentionedMobileList []string) string
- func SendTextMsg(accessToken string, msg string, isAtAll bool, atUserIds []string, ...) string
- type AtBody
- type MarkdownBody
- type MarkdownMsgBody
- type MarkdownMsgParams
- type MarkdownParams
- type TextBody
- type TextMsgBody
- type TextMsgParams
- type TextParams
Constants ¶
View Source
const ( AlertMsgKey = "3bc2c0f7-d1c6-4c31-9afe-42bd4e103bef" // WeChatSwitchOn 企业微信发送开关 WeChatSwitchOn = true )
View Source
const (
WebHook = "https://open.feishu.cn/open-apis/bot/v2/hook/b1e8ca8e-154a-49c7-8efe-2e25360da46a"
)
Variables ¶
View Source
var ( SwitchOn bool BaseUrl string AccessToken string )
钉钉机器人发送开关
Functions ¶
func InitDingTalk ¶
func SendLarkMsg ¶
func SendMarkdownMessage ¶
func SendMarkdownMessage(accessToken string, title string, text string, isAtAll bool, atUserIds []string, atMobiles []string) string
SendMarkdownMessage 发送POST请求,消息格式:markdown accessToken: 机器人access_token title: 消息标题 text: 消息正文 isAtAll: 是否@所有人 atUserIds: 希望通过user id@的人 atMobiles: 希望通过手机号@的人
func SendMarkdownMsg ¶
SendMarkdownMsg 发送POST请求,消息格式:markdown key: 微信机器人key msg: 消息内容 atList: 希望@的人 mentionedMobileList: 希望通过手机号@的人
Types ¶
type MarkdownBody ¶
type MarkdownBody struct {
Content string `json:"content"`
}
type MarkdownMsgBody ¶
type MarkdownMsgParams ¶
type MarkdownMsgParams struct { MsgType string `json:"msgtype"` MarkDown MarkdownMsgBody `json:"markdown"` At AtBody `json:"at"` }
MarkdownMsgParams markdown类型消息数据
type MarkdownParams ¶
type MarkdownParams struct { MsgType string `json:"msgtype"` MarkDown MarkdownBody `json:"markdown"` }
MarkdownParams markdown类型消息数据
type TextMsgBody ¶
type TextMsgBody struct {
Content string `json:"content"`
}
type TextMsgParams ¶
type TextMsgParams struct { MsgType string `json:"msgtype"` Text TextMsgBody `json:"text"` At AtBody `json:"at"` }
TextMsgParams text类型消息数据
type TextParams ¶
TextParams text类型消息数据
Click to show internal directories.
Click to hide internal directories.