Documentation
¶
Index ¶
- func Init(appName, appSign string)
- func InitOAuthApp(clientId, clientSecret string)
- func InitPrivateApp(token *string)
- type DingTalkMsgLinkInput
- type DingTalkMsgMarkdownInput
- type DingTalkMsgPlainTextInput
- type DingTalkNoticeBody
- type MiniProgram
- type SendResult
- type Template
- func (t *Template) NewApp(title, subtitle, content, extra string) *UniNotifyInput
- func (t *Template) NewDingTalk() *DingTalkNoticeBody
- func (t *Template) NewWeChat() *WeChatNoticeBody
- func (t *Template) Receiver(staffId ...string) *Template
- func (t *Template) Send() error
- func (t *Template) WithContext(ctx context.Context) *Template
- type TemplateDataItem
- type UniNotifyInput
- type WeChatNoticeBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitOAuthApp ¶
func InitOAuthApp(clientId, clientSecret string)
InitOAuthApp OAuth应用认证初始化 (发送范围仅限授权过该OAuth应用的用户)
func InitPrivateApp ¶
func InitPrivateApp(token *string)
InitPrivateApp 个人token认证初始化 (发送范围仅限token对应用户)
Types ¶
type DingTalkMsgLinkInput ¶
type DingTalkMsgPlainTextInput ¶
type DingTalkMsgPlainTextInput struct {
Content string `json:"content"`
}
type DingTalkNoticeBody ¶
type DingTalkNoticeBody struct {
MsgType string `json:"msgtype"`
Text *DingTalkMsgPlainTextInput `json:"text,omitempty"`
Link *DingTalkMsgLinkInput `json:"link,omitempty"`
Markdown *DingTalkMsgMarkdownInput `json:"markdown,omitempty"`
}
func (*DingTalkNoticeBody) LinkMsg ¶
func (t *DingTalkNoticeBody) LinkMsg(messageUrl, picUrl, title, text string)
func (*DingTalkNoticeBody) MarkdownMsg ¶
func (t *DingTalkNoticeBody) MarkdownMsg(title, text string)
func (*DingTalkNoticeBody) PlainText ¶
func (t *DingTalkNoticeBody) PlainText(content string)
type MiniProgram ¶
type SendResult ¶
type Template ¶
type Template struct {
StaffID []string `json:"StaffID"`
WeChat *WeChatNoticeBody `json:"template,omitempty"`
DingTalk *DingTalkNoticeBody `json:"dingtalk,omitempty"`
App *UniNotifyInput `json:"body,omitempty"`
// contains filtered or unexported fields
}
func (*Template) NewApp ¶
func (t *Template) NewApp(title, subtitle, content, extra string) *UniNotifyInput
func (*Template) NewDingTalk ¶
func (t *Template) NewDingTalk() *DingTalkNoticeBody
func (*Template) NewWeChat ¶
func (t *Template) NewWeChat() *WeChatNoticeBody
type TemplateDataItem ¶
TemplateDataItem 模版内某个 .DATA 的值
type UniNotifyInput ¶
type WeChatNoticeBody ¶
type WeChatNoticeBody struct {
Data map[string]*TemplateDataItem `json:"data"`
TemplateID string `json:"template_id"`
ToUser string `json:"touser"`
URL string `json:"url"`
MiniProgram *MiniProgram `json:"miniprogram,omitempty"`
}
func (*WeChatNoticeBody) MiniPro ¶
func (t *WeChatNoticeBody) MiniPro(appid, pagePath string) *WeChatNoticeBody
func (*WeChatNoticeBody) SetData ¶
func (t *WeChatNoticeBody) SetData(key, value, color string) *WeChatNoticeBody
func (*WeChatNoticeBody) SetTmpl ¶
func (t *WeChatNoticeBody) SetTmpl(templateId string) *WeChatNoticeBody
func (*WeChatNoticeBody) Url ¶
func (t *WeChatNoticeBody) Url(url string) *WeChatNoticeBody
Click to show internal directories.
Click to hide internal directories.