Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DINGDINGSendErr = errors.New("send DINGDING fail") DINGDINGBadURLErr = errors.New("bad DINGDING URL") )
Functions ¶
func New ¶
func New(proxy string) subscriber.Subscriber
func PrettyPrint ¶
PrettyPrint 钉钉消息显示的处理 1. 如果 content 能反序列化成 string,那么使用反序列化后的内容作为钉钉消息内容 2. 如果 content 能使用json反序列,那么对使用带缩进的反序列化后的内容作为钉钉消息内容 3. 否则,直接使用 content
Types ¶
type DDContent ¶
type DDContent struct {
Content string `json:"content"`
}
example dingding message:
{ "msgtype": "text", "text": { "content": "我就是我, @1825718XXXX 是不一样的烟火" }, "at": { "atMobiles": [ "1825718XXXX" ], "isAtAll": false } }
type DDDest ¶
type DDDest [][]string
[[A,B,C],[D,E,F],[G,H,I]] -> A,B,C 中随机选一个发送消息,如果失败则换这3个中的下一个地址来重试,D,E,F 和 G,H,I也一样
type DDMarkdown ¶
type DDMessage ¶
type DDMessage struct { Msgtype string `json:"msgtype"` Text *DDContent `json:"text,omitempty"` Markdown *DDMarkdown `json:"markdown,omitempty"` At DDAt `json:"at"` }
type DDSubscriber ¶
type DDSubscriber struct {
// contains filtered or unexported fields
}
func (*DDSubscriber) DINGDINGSend ¶
func (d *DDSubscriber) DINGDINGSend(u string, m *DDMessage) error
func (*DDSubscriber) Name ¶
func (d *DDSubscriber) Name() string
func (*DDSubscriber) Publish ¶
example URL:https://oapi.dingtalk.com/robot/send?access_token=xxxx
func (*DDSubscriber) Status ¶
func (d *DDSubscriber) Status() interface{}
type LegacyDDDest ¶
type LegacyDDDest []string
Click to show internal directories.
Click to hide internal directories.