Documentation
¶
Index ¶
Constants ¶
View Source
const ( KeyWord SecureType = iota Sign Custom RobotType = iota DingDingRobotAddr = `https://oapi.dingtalk.com/robot/send` ContentType = `application/json; charset=utf-8` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (Config) AccessToken ¶
func (Config) SecureType ¶
func (c Config) SecureType() SecureType
type LinkContent ¶
type LinkContent struct { Text string `json:"text,omitempty"` Title string `json:"title,omitempty"` PicUrl string `json:"picUrl,omitempty"` MessageUrl string `json:"messageUrl,omitempty"` }
func (LinkContent) Apply ¶
func (l LinkContent) Apply(msg *Message)
func (LinkContent) Type ¶
func (l LinkContent) Type() string
type MarkdownContent ¶
type MarkdownContent struct { Title string `json:"title,omitempty"` Text string `json:"text,omitempty"` }
Markdown 消息
func (MarkdownContent) Apply ¶
func (m MarkdownContent) Apply(msg *Message)
func (MarkdownContent) Type ¶
func (m MarkdownContent) Type() string
type Message ¶
type Message struct { Typ string `json:"msgtype"` AT *at `json:"at,omitempty"` Text TextContent `json:"text,omitempty"` Link LinkContent `json:"link,omitempty"` Markdown MarkdownContent `json:"markdown,omitempty"` // contains filtered or unexported fields }
基础消息体
func NewLinkMessage ¶
func NewMarkdownMessage ¶
func NewMessage ¶
func NewMessage() *Message
func NewTextMessage ¶
func (*Message) AddAtMobiles ¶
func (*Message) SetContent ¶
func (m *Message) SetContent(content MessageContent)
func (*Message) SetIsAtAll ¶
type MessageContent ¶
消息类型接口
func NewLinkContent ¶
func NewLinkContent(text, title, picUrl, messageUrl string) MessageContent
func NewMarkdownContent ¶
func NewMarkdownContent(text, title string) MessageContent
func NewTextContent ¶
func NewTextContent(content string) MessageContent
type SecureType ¶
type SecureType int
type TextContent ¶
type TextContent struct {
Content string `json:"content"`
}
纯文本消息
func (TextContent) Apply ¶
func (t TextContent) Apply(m *Message)
func (TextContent) Type ¶
func (t TextContent) Type() string
type WithAccessToken ¶
type WithAccessToken string
func (WithAccessToken) Apply ¶
func (at WithAccessToken) Apply(config *Config)
type WithSecret ¶
type WithSecret string
func (WithSecret) Apply ¶
func (s WithSecret) Apply(config *Config)
type WithSecureType ¶
type WithSecureType SecureType
func (WithSecureType) Apply ¶
func (st WithSecureType) Apply(config *Config)
Click to show internal directories.
Click to hide internal directories.