Documentation
¶
Index ¶
- Constants
- func RobotUrl(accessToken, secret string) (string, error)
- func SendRobotMarkDownMessage(token, title, content string) error
- func SendRobotMarkDownMessageWithSecret(token, secret, title, content string) error
- func SendRobotMessage(accessToken, secret, title, content string, contentType ContentType) error
- func SendRobotTextMessage(accessToken string, content string) error
- func SendRobotTextMessageWithSecret(accessToken, secret, content string) error
- type At
- type ContentType
- type DingMsg
- type Text
Constants ¶
View Source
const ( //VERSION is SDK version VERSION = "0.1" //ROOT is the root url ROOT = "https://oapi.dingtalk.com/" ContentTypeTextTmpl = `{"msgtype":"text","text":{"content":"%s"}}` ContentTypeMarkdownTmpl = `{"msgtype":"markdown","markdown":{"title":"%s","text":"%s"}}` ContentTypeMarkdownAtTmpl = `{"msgtype":"markdown","markdown":{"title":"%s","text":"%s"},"at":{"isAtAll": false, "atMobiles":[]}}` )
Variables ¶
This section is empty.
Functions ¶
func SendRobotMessage ¶
func SendRobotMessage(accessToken, secret, title, content string, contentType ContentType) error
func SendRobotTextMessage ¶
SendRobotTextMessage can send a text message to a group chat
Types ¶
type ContentType ¶
type ContentType int
const ( ContentTypeText ContentType = iota ContentTypeMarkdown )
func (ContentType) Body ¶
func (c ContentType) Body(title, content string) string
func (ContentType) String ¶
func (c ContentType) String() string
func (ContentType) Tmpl ¶
func (c ContentType) Tmpl() string
Click to show internal directories.
Click to hide internal directories.