Documentation ¶
Index ¶
- Constants
- func Format(msg MessageType) string
- func RobotSendMarkDownMessage(token, title, content string, at *At) error
- func RobotSendMarkDownMessageWithSecret(token, secret, title, content string, at *At) error
- func RobotSendMessage(accessToken, secret string, msg MessageType) error
- func RobotSendTextMessage(accessToken string, content string) error
- func RobotSendTextMessageWithSecret(accessToken, secret, content string) error
- func RobotUrl(accessToken, secret string) (string, error)
- func TextMessage(text string) string
- type ActionCard
- type At
- type FeedCard
- type Link
- type Markdown
- type MessageType
- type MsgType
- type Robot
- type RobotConfig
- type Text
Constants ¶
View Source
const ( //VERSION is SDK version VERSION = "0.1" //ROOT is the root url ROOT = "https://oapi.dingtalk.com/" )
View Source
const (
MsgTypeTmpl = `{"msgtype":"%s",%s}`
)
Variables ¶
This section is empty.
Functions ¶
func Format ¶
func Format(msg MessageType) string
func RobotSendMessage ¶
func RobotSendMessage(accessToken, secret string, msg MessageType) error
func RobotSendTextMessage ¶
RobotSendTextMessage can send a text message to a group chat
func TextMessage ¶
Types ¶
type ActionCard ¶
type ActionCard struct { Title string `json:"title"` Text string `json:"text"` BtnOrientation string `json:"btnOrientation"` SingleTitle string `json:"singleTitle"` SingleURL string `json:"singleURL"` }
func (*ActionCard) MessageType ¶
func (*ActionCard) MessageType() MsgType
type FeedCard ¶
type FeedCard struct { Links []struct { Title string `json:"title"` MessageURL string `json:"messageURL"` PicURL string `json:"picURL"` } `json:"links"` }
func (*FeedCard) MessageType ¶
type Link ¶
type Link struct { Text string `json:"text"` Title string `json:"title"` PicUrl string `json:"picUrl"` MessageUrl string `json:"messageUrl"` }
func (*Link) MessageType ¶
type Markdown ¶
type Markdown struct { Title string `json:"title"` Text string `json:"text"` At *At `json:"at,omitempty"` }
func (*Markdown) MessageType ¶
type MessageType ¶
type MessageType interface {
MessageType() MsgType
}
type MsgType ¶
type MsgType int
const ( MsgTypeText MsgType MsgTypeMarkdown MsgTypeLink MsgTypeActionCard MsgTypeFeedCard )
type Robot ¶
func (*Robot) SendMessage ¶
func (r *Robot) SendMessage(msg MessageType) error
type RobotConfig ¶
Click to show internal directories.
Click to hide internal directories.