Documentation
¶
Index ¶
- Constants
- func AddBlue(text string) string
- func AddGold(text string) string
- func AddGreen(text string) string
- func AddH1(text string) string
- func AddH2(text string) string
- func AddH3(text string) string
- func AddH4(text string) string
- func AddH5(text string) string
- func AddH6(text string) string
- func AddRed(text string) string
- func DingMap() *dingMap
- func NewActionCardMsg(title, text string, opts ...ActionCardOption) *actionCardMsg
- func NewDTMDMsg(title string, dtmdMap *dingMap, opts ...AtOption) *markDownMsg
- func NewFeedCardMsg(feedCard []FeedCardLinkModel) *feedCardMsg
- func NewLinkMsg(title, text, picUrl, msgUrl string) *linkMsg
- func NewMarkDownMsg(title string, text interface{}, opts ...AtOption) *markDownMsg
- func NewTextMsg(content string, opts ...AtOption) *textMsg
- type ActionCardMultiBtnModel
- type ActionCardOption
- type AtOption
- type DingTalk
- func (d *DingTalk) OutGoing(r io.Reader) (outGoingMsg OutGoingModel, err error)
- func (d *DingTalk) SendActionCardMessage(title, text string, opts ...ActionCardOption) error
- func (d *DingTalk) SendActionCardMessageBySlice(title string, textList []string, opts ...ActionCardOption) error
- func (d *DingTalk) SendDTMDMessage(title string, dtmdMap *dingMap, opt ...AtOption) error
- func (d *DingTalk) SendFeedCardMessage(feedCard []FeedCardLinkModel) error
- func (d *DingTalk) SendLinkMessage(title, text, picUrl, msgUrl string) error
- func (d *DingTalk) SendMarkDownMessage(title string, text Format, opts ...AtOption) error
- func (d DingTalk) SendMarkDownMessageBySlice(title string, textList []string, opts ...AtOption) error
- func (d *DingTalk) SendTextMessage(content string, opt ...AtOption) error
- type FeedCardLinkModel
- type Format
- type MarkType
- type OutGoingModel
Constants ¶
View Source
const ( TEXT msgTypeType = "text" LINK msgTypeType = "link" MARKDOWN msgTypeType = "markdown" ACTION_CARD msgTypeType = "actionCard" FEED_CARD msgTypeType = "feedCard" )
Variables ¶
This section is empty.
Functions ¶
func NewActionCardMsg ¶
func NewActionCardMsg(title, text string, opts ...ActionCardOption) *actionCardMsg
func NewDTMDMsg ¶
func NewFeedCardMsg ¶
func NewFeedCardMsg(feedCard []FeedCardLinkModel) *feedCardMsg
func NewLinkMsg ¶
func NewLinkMsg(title, text, picUrl, msgUrl string) *linkMsg
func NewMarkDownMsg ¶
func NewTextMsg ¶
Types ¶
type ActionCardMultiBtnModel ¶
type ActionCardOption ¶
type ActionCardOption interface {
// contains filtered or unexported methods
}
func WithCardBtnVertical ¶
func WithCardBtnVertical() ActionCardOption
func WithCardBtns ¶
func WithCardBtns(btns []ActionCardMultiBtnModel) ActionCardOption
func WithCardSingleTitle ¶
func WithCardSingleTitle(title string) ActionCardOption
func WithCardSingleURL ¶
func WithCardSingleURL(url string) ActionCardOption
type AtOption ¶
type AtOption interface {
// contains filtered or unexported methods
}
func WithAtMobiles ¶
type DingTalk ¶
type DingTalk struct {
// contains filtered or unexported fields
}
func InitDingTalk ¶
func InitDingTalkWithSecret ¶
func (*DingTalk) OutGoing ¶
func (d *DingTalk) OutGoing(r io.Reader) (outGoingMsg OutGoingModel, err error)
func (*DingTalk) SendActionCardMessage ¶
func (d *DingTalk) SendActionCardMessage(title, text string, opts ...ActionCardOption) error
func (*DingTalk) SendActionCardMessageBySlice ¶
func (d *DingTalk) SendActionCardMessageBySlice(title string, textList []string, opts ...ActionCardOption) error
func (*DingTalk) SendDTMDMessage ¶
利用dtmd发送点击消息
func (*DingTalk) SendFeedCardMessage ¶
func (d *DingTalk) SendFeedCardMessage(feedCard []FeedCardLinkModel) error
func (*DingTalk) SendLinkMessage ¶
func (*DingTalk) SendMarkDownMessage ¶
func (DingTalk) SendMarkDownMessageBySlice ¶
type FeedCardLinkModel ¶
type Format ¶
type Format interface {
//添加一行
AddText(text string, color ...interface{})
//添加图片
AddImage(url string)
//一次性加多个图片
AddImages(urls []string)
//获取处理好的数据格式
GetContext() string
//以key:value的数据格式
AddKeyValue(title string, value interface{})
//链接
AddTextUrl(text string, hrefs map[string]string)
}
func NewConText ¶
func NewConText() Format
type OutGoingModel ¶
type OutGoingModel struct {
AtUsers []struct {
DingtalkID string `json:"dingtalkId"`
} `json:"atUsers"`
ChatbotUserID string `json:"chatbotUserId"`
ConversationID string `json:"conversationId"`
ConversationTitle string `json:"conversationTitle"`
ConversationType string `json:"conversationType"`
CreateAt int64 `json:"createAt"`
IsAdmin bool `json:"isAdmin"`
IsInAtList bool `json:"isInAtList"`
MsgID string `json:"msgId"`
Msgtype string `json:"msgtype"`
SceneGroupCode string `json:"sceneGroupCode"`
SenderID string `json:"senderId"`
SenderNick string `json:"senderNick"`
SessionWebhook string `json:"sessionWebhook"`
SessionWebhookExpiredTime int64 `json:"sessionWebhookExpiredTime"`
Text struct {
Content string `json:"content"`
} `json:"text"`
}
Click to show internal directories.
Click to hide internal directories.