Documentation ¶
Index ¶
Constants ¶
View Source
const MsgTypeLink = "link"
View Source
const MsgTypeMarkdown = "markdown"
View Source
const MsgTypeText = "text"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRobot ¶
type ChatRobot struct { //钉钉发送地址 格式如:https://oapi.dingtalk.com/robot/send?access_token=1122344 Url string //地址密钥 安全设置中加签 加签 Secret string }
func NewDingDingTalkRobot ¶
func (*ChatRobot) Send ¶
func (d *ChatRobot) Send(msg interface{}) (ResponseResult, error)
Send 发送ding talk。msg类型必须为TextMsg或者LinkMsg或者MarkdownMsg
type LinkMsg ¶
type LinkMsg struct { MsgType string `json:"msgtype"` Link struct { Text string `json:"text"` Title string `json:"title"` PicUrl string `json:"picUrl"` MessageUrl string `json:"messageUrl"` } `json:"link"` }
LinkMsg link类型
func NewLinkMsg ¶
func NewLinkMsg() LinkMsg
type MarkdownMsg ¶
type MarkdownMsg struct { MsgType string `json:"msgtype"` Markdown struct { Title string `json:"title"` Text string `json:"text"` } `json:"markdown"` At struct { AtMobiles []string `json:"atMobiles"` AtUserIds []string `json:"atUserIds"` IsAtAll bool `json:"isAtAll"` } `json:"at"` }
MarkdownMsg markdown类型
func NewMarkdownMsg ¶
func NewMarkdownMsg() MarkdownMsg
type ResponseResult ¶
ResponseResult 返回结果
type TextMsg ¶
type TextMsg struct { MsgType string `json:"msgtype"` Text struct { Content string `json:"content"` } `json:"text"` At struct { AtMobiles []string `json:"atMobiles"` AtUserIds []string `json:"atUserIds"` IsAtAll bool `json:"isAtAll"` } `json:"at"` }
TextMsg 类型文档类型
func NewTextMsg ¶
func NewTextMsg() TextMsg
Click to show internal directories.
Click to hide internal directories.