Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTimeFormat = errors.New("格式不正确,例: 2021-11-16T16:20:49+08:00 ~ 2021-11-16T16:20:49+08:00") ErrIgnoreMessage = errors.New("message are ignored") )
Functions ¶
This section is empty.
Types ¶
type ActionCardType ¶
type FeedCardType ¶
type FeedCardType struct {
Links []LinkType `json:"links"`
}
type IgnoreMessageType ¶
type LimitSenderType ¶
type LimitSenderType struct { SenderType // 发送钉钉的间隔时间 Interval time.Duration // 在 Interval 内总共发送多少次 Limit int // 忽略的消息列表 Ignore []IgnoreMessageType }
func NewLimitSender ¶
func NewLimitSender(token, secret string, limit int, duration time.Duration, ignores []IgnoreMessageType) *LimitSenderType
func (*LimitSenderType) LimitSender ¶
func (c *LimitSenderType) LimitSender(Title, Msg string) error
type MarkdownType ¶
type Message ¶
type Message struct { MsgType MessageType `json:"msgtype"` Markdown MarkdownType `json:"markdown,omitempty"` Text TextType `json:"text,omitempty"` At AtType `json:"at,omitempty"` ActionCard ActionCardType `json:"actionCard,omitempty"` Link LinkType `json:"link,omitempty"` FeedCard FeedCardType `json:"feedCard,omitempty"` }
type MessageType ¶
type MessageType string
const ( Text MessageType = "text" Link MessageType = "link" Markdown MessageType = "markdown" ActionCard MessageType = "actionCard" FeedCard MessageType = "feedCard" )
type SenderType ¶
func NewSender ¶
func NewSender(token, secret string) *SenderType
func (*SenderType) MarkdownSender ¶
func (c *SenderType) MarkdownSender(Title, Msg string, atUser []string, atAll bool) error
func (*SenderType) Sender ¶
func (c *SenderType) Sender(Msg *Message) error
Click to show internal directories.
Click to hide internal directories.