Documentation ¶
Index ¶
- Constants
- func GetDingSign(token string) (timestamp string, sign string)
- func PushEmail(host, user, token, fromEmailAddr string, fromName string, ...) error
- func PushPushDeer(setting PushDeerSetting, title string, content string, markDown bool) error
- func SendDingMessage(accessToken, secret string, message DingMessage) error
- type At
- type DingActionCard
- type DingFeedCard
- type DingLink
- type DingMarkdown
- type DingMessage
- type DingRobotMgr
- func (m *DingRobotMgr) Init(setting DingSetting) error
- func (m *DingRobotMgr) Push(title string, content string) error
- func (m *DingRobotMgr) PushMarkDown(title string, content string) error
- func (m *DingRobotMgr) Send(message DingMessage) error
- func (m *DingRobotMgr) SetSetting(setting interface{}) error
- type DingRobotToken
- type DingSetting
- type DingText
- type EmailMgr
- type EmailSetting
- type PushDeerMgr
- type PushDeerSetting
Constants ¶
View Source
const ( ErrTypeErr = misc.ErrStr("type err") ErrPushDeerPushFail = misc.ErrStr("pushdeer push fail") )
前面的err是用来区分类型的,所以看上去有点扭曲
View Source
const ApiUrl = "https://oapi.dingtalk.com/robot/send"
Variables ¶
This section is empty.
Functions ¶
func PushPushDeer ¶
func PushPushDeer(setting PushDeerSetting, title string, content string, markDown bool) error
func SendDingMessage ¶
func SendDingMessage(accessToken, secret string, message DingMessage) error
Types ¶
type DingActionCard ¶
type DingActionCard struct { MsgType string `json:"msgtype"` ActionCard struct { Title string `json:"title"` Text string `json:"text"` BtnOrientation string `json:"btnOrientation"` Btns []struct { Title string `json:"title"` ActionURL string `json:"actionURL"` } `json:"btns"` SingleTitle string `json:"singleTitle"` SingleURL string `json:"singleURL"` } `json:"actionCard"` }
func NewDingActionCard ¶
func NewDingActionCard() *DingActionCard
func (*DingActionCard) ToJson ¶
func (m *DingActionCard) ToJson() string
type DingFeedCard ¶
type DingLink ¶
type DingLink struct { MsgType string `json:"msgtype"` Link struct { Text string `json:"text"` Title string `json:"title"` PicUrl string `json:"picUrl"` MessageUrl string `json:"messageUrl"` } `json:"link"` }
func NewDingLink ¶
func NewDingLink() *DingLink
type DingMarkdown ¶
type DingMarkdown struct { MsgType string `json:"msgtype"` Markdown struct { Title string `json:"title"` Text string `json:"text"` } `json:"markdown"` At At `json:"at"` }
func NewDingMarkdown ¶
func NewDingMarkdown() *DingMarkdown
func (*DingMarkdown) ToJson ¶
func (m *DingMarkdown) ToJson() string
type DingMessage ¶
type DingMessage interface {
ToJson() string
}
type DingRobotMgr ¶
type DingRobotMgr struct {
// contains filtered or unexported fields
}
func NewDingRobotMgr ¶
func NewDingRobotMgr(setting DingSetting) (*DingRobotMgr, error)
func (*DingRobotMgr) Init ¶
func (m *DingRobotMgr) Init(setting DingSetting) error
func (*DingRobotMgr) PushMarkDown ¶
func (m *DingRobotMgr) PushMarkDown(title string, content string) error
func (*DingRobotMgr) Send ¶
func (m *DingRobotMgr) Send(message DingMessage) error
func (*DingRobotMgr) SetSetting ¶
func (m *DingRobotMgr) SetSetting(setting interface{}) error
type DingRobotToken ¶
type DingRobotToken struct {
// contains filtered or unexported fields
}
type DingSetting ¶
type DingText ¶
type DingText struct { At At `json:"at"` Text struct { Content string `json:"content"` } `json:"text"` MsgType string `json:"msgtype"` }
func NewDingText ¶
func NewDingText() *DingText
type EmailMgr ¶
type EmailMgr struct { misc.InitTag EmailSetting EmailSetting }
func NewEmailMgr ¶
func NewEmailMgr(setting EmailSetting) (*EmailMgr, error)
func (*EmailMgr) Init ¶
func (m *EmailMgr) Init(setting EmailSetting) error
func (*EmailMgr) SetSetting ¶
type EmailSetting ¶
type PushDeerMgr ¶
func NewPushDeerMgr ¶
func NewPushDeerMgr(setting *PushDeerSetting) (*PushDeerMgr, error)
func (*PushDeerMgr) Init ¶
func (m *PushDeerMgr) Init(setting *PushDeerSetting) error
func (*PushDeerMgr) PushMarkDown ¶
func (m *PushDeerMgr) PushMarkDown(title string, content string) error
func (*PushDeerMgr) SetSetting ¶
func (m *PushDeerMgr) SetSetting(setting interface{}) error
type PushDeerSetting ¶
type PushDeerSetting struct {
Token string
}
Click to show internal directories.
Click to hide internal directories.