Documentation ¶
Index ¶
- Constants
- type ActionCard
- func (a *ActionCard) GetBtnOrientation() string
- func (a *ActionCard) GetBtns() []Btn
- func (a *ActionCard) GetHideAvatar() string
- func (a *ActionCard) GetSingleTitle() string
- func (a *ActionCard) GetSingleURL() string
- func (a *ActionCard) GetText() string
- func (a *ActionCard) GetTitle() string
- func (ActionCard) GetType() string
- func (a *ActionCard) SetBtnOrientation(btnOrientation string)
- func (a *ActionCard) SetBtns(btns []Btn)
- func (a *ActionCard) SetHideAvatar(hideAvatar string)
- func (a *ActionCard) SetSingleTitle(singleTitle string)
- func (a *ActionCard) SetSingleURL(singleURL string)
- func (a *ActionCard) SetText(text string)
- func (a *ActionCard) SetTitle(title string)
- type At
- type Btn
- type FeedCard
- type FeedCardLink
- type IMsg
- type Link
- func (l *Link) GetMessageUrl() string
- func (l *Link) GetPicURL() string
- func (l *Link) GetText() string
- func (l *Link) GetTitle() string
- func (Link) GetType() string
- func (l *Link) SetMessageUrl(messageURL string)
- func (l *Link) SetPicURL(picURL string)
- func (l *Link) SetText(text string)
- func (l *Link) SetTitle(title string)
- type Markdown
- type Send
- type SendOption
- type Text
Constants ¶
View Source
const ( M_TEXT msgType = iota M_LINK M_MARKDOWN M_ACTIONCARD M_FEEDCARD )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionCard ¶
type ActionCard struct { // Title 首屏会话透出的展示内容 Title string `json:"title"` // Text markdown格式的消息 Text string `json:"text"` // SingleTitle 单个按钮的方案。(设置此项和singleURL后btns无效) SingleTitle string `json:"singleTitle"` // SingleURL 点击singleTitle按钮触发的URL SingleURL string `json:"singleURL"` // HideAvatar 0-正常发消息者头像,1-隐藏发消息者头像 HideAvatar string `json:"hideAvatar,omitempty"` // Btns 按钮的信息:title-按钮方案,actionURL-点击按钮触发的URL Btns []Btn `json:"btns,omitempty"` // BtnOrientation 0-按钮竖直排列,1-按钮横向排列 BtnOrientation string `json:"btnOrientation,omitempty"` }
ActionCard actionCard类型
func (*ActionCard) GetBtnOrientation ¶
func (a *ActionCard) GetBtnOrientation() string
func (*ActionCard) GetBtns ¶
func (a *ActionCard) GetBtns() []Btn
func (*ActionCard) GetHideAvatar ¶
func (a *ActionCard) GetHideAvatar() string
func (*ActionCard) GetSingleTitle ¶
func (a *ActionCard) GetSingleTitle() string
func (*ActionCard) GetSingleURL ¶
func (a *ActionCard) GetSingleURL() string
func (*ActionCard) GetText ¶
func (a *ActionCard) GetText() string
func (*ActionCard) GetTitle ¶
func (a *ActionCard) GetTitle() string
func (ActionCard) GetType ¶
func (ActionCard) GetType() string
func (*ActionCard) SetBtnOrientation ¶
func (a *ActionCard) SetBtnOrientation(btnOrientation string)
func (*ActionCard) SetBtns ¶
func (a *ActionCard) SetBtns(btns []Btn)
func (*ActionCard) SetHideAvatar ¶
func (a *ActionCard) SetHideAvatar(hideAvatar string)
func (*ActionCard) SetSingleTitle ¶
func (a *ActionCard) SetSingleTitle(singleTitle string)
func (*ActionCard) SetSingleURL ¶
func (a *ActionCard) SetSingleURL(singleURL string)
func (*ActionCard) SetText ¶
func (a *ActionCard) SetText(text string)
func (*ActionCard) SetTitle ¶
func (a *ActionCard) SetTitle(title string)
type At ¶
type At struct { // atMobiles 被@人的手机号(在text内容里要有@手机号) AtMobiles []string `json:"atMobiles,omitempty"` // isAtAll @所有人时:true,否则为:false IsAtAll bool `json:"isAtAll,omitempty"` }
At @
func (*At) GetAtMobiles ¶
func (*At) GetIsAtAll ¶
func (*At) SetAtMobiles ¶
func (*At) SetIsAtAll ¶
type Btn ¶
type Btn struct { // Title 按钮方案 Title string `json:"title"` // ActionURL 点击按钮触发的URL ActionURL string `json:"actionURL"` }
Btn 按钮的信息
func (*Btn) GetActionURL ¶
func (*Btn) SetActionURL ¶
type FeedCard ¶
type FeedCard struct {
Links []FeedCardLink `json:"links"`
}
FeedCard 资讯类信息
func (*FeedCard) GetLinks ¶
func (f *FeedCard) GetLinks() []FeedCardLink
func (*FeedCard) SetLinks ¶
func (f *FeedCard) SetLinks(links []FeedCardLink)
type FeedCardLink ¶
type FeedCardLink struct { //Title 单条信息文本 Title string `json:"title"` // MessageURL 点击单条信息到跳转链接 MessageURL string `json:"messageURL"` // PicURL 单条信息后面图片的URL PicURL string `json:"picURL"` }
func (*FeedCardLink) GetMessageURL ¶
func (f *FeedCardLink) GetMessageURL() string
func (*FeedCardLink) GetPicURL ¶
func (f *FeedCardLink) GetPicURL() string
func (*FeedCardLink) GetTitle ¶
func (f *FeedCardLink) GetTitle() string
func (*FeedCardLink) SetMessageURL ¶
func (f *FeedCardLink) SetMessageURL(messageURL string)
func (*FeedCardLink) SetPicURL ¶
func (f *FeedCardLink) SetPicURL(picURL string)
func (*FeedCardLink) SetTitle ¶
func (f *FeedCardLink) SetTitle(title string)
type Link ¶
type Link struct { // Title 消息标题 Title string `json:"title"` // Text 消息内容。如果太长只会部分展示 Text string `json:"text,omitempty"` // MessageURL 点击消息跳转的URL MessageURL string `json:"messageUrl"` // PicURL 图片URL PicURL string `json:"picUrl,omitempty"` }
Link link类型
func (*Link) GetMessageUrl ¶
func (*Link) SetMessageUrl ¶
type Markdown ¶
type Markdown struct { // Title 首屏会话透出的展示内容 Title string `json:"title"` // Text markdown格式的消息 Text string `json:"text"` }
Markdown markdown类型
type Send ¶
type Send struct {
// contains filtered or unexported fields
}
func NewSend ¶
func NewSend(msg IMsg, options ...SendOption) *Send
func (*Send) GetApiName ¶
func (*Send) GetMsgType ¶
func (*Send) GetSuccessCode ¶
type SendOption ¶
type SendOption func(*Send)
func SendWithAtMobiles ¶
func SendWithAtMobiles(atMobiles []string) SendOption
func SendWithIsAtAll ¶
func SendWithIsAtAll(isAtAll bool) SendOption
Click to show internal directories.
Click to hide internal directories.