Documentation
¶
Overview ¶
Package dinghook 详情参见 https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.karFPe&treeId=257&articleId=105735&docType=1
Index ¶
Constants ¶
View Source
const ( // MsgTypeText text 类型 MsgTypeText = "text" // MsgTypeLink link 类型 MsgTypeLink = "link" // MsgTypeMarkdown markdown 类型 MsgTypeMarkdown = "markdown" )
View Source
const (
// DingAPIURL api 地址
DingAPIURL = `https://oapi.dingtalk.com/robot/send?access_token=`
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DingQueue ¶
type DingQueue struct { AccessToken string Interval uint // 发送间隔s,最小为1 Limit uint // 每次发送消息限制,0 无限制,到达时间则发送队列所有消息,大于1则到时间发送最大Limit数量的消息 Title string // 摘要 // contains filtered or unexported fields }
DingQueue 用queue 方式发送消息 会发送 markdown 类型消息
func (*DingQueue) PushMessage ¶
func (ding *DingQueue) PushMessage(m SimpleMessage)
PushMessage push 消息到队列
type Link ¶
type Link struct { Content string `json:"text" validate:"required"` // 要发送的消息, 必填 Title string `json:"title" validate:"required"` // 标题, 必填 ContentURL string `json:"messageUrl" validate:"required"` // 点击消息跳转的URL 必填 PictureURL string `json:"picUrl"` // 图片 url }
Link 链接消息
type Markdown ¶
type Markdown struct { Content string `json:"text" validate:"required"` // 要发送的消息, 必填 Title string `json:"title" validate:"required"` // 标题, 必填 }
Markdown markdown 类型
type Result ¶
type Result struct { Success bool // ErrMsg 错误信息 ErrMsg string `json:"errmsg"` // 错误码 ErrCode int `json:"errcode"` }
Result 发送结果 Success true 成功,否则失败 ErrMsg 错误信息,如果是钉钉接口错误,会返回钉钉的错误信息,否则返回内部err信息 ErrCode 钉钉返回的错误码
type SimpleMessage ¶
SimpleMessage push message
Click to show internal directories.
Click to hide internal directories.