Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMessage ¶
func NewMessage(content Content, opts ...MessageOption) reporter.Message
func NewReporter ¶
Example ¶
reporter := NewReporter( "https://oapi.dingtalk.com/robot/send?access_token=xxx", Secret("xxx"), ) if err := reporter.Report(context.Background(), NewMessage( NewText("我就是我, @XXX 是不一样的烟火"), AtAll(), )); err != nil { log.Fatalf("report the message error: %s", err) }
Output:
Types ¶
type Content ¶
type Content interface { Type() string Body() interface{} }
func NewMarkdown ¶
Example ¶
reporter := NewReporter( "https://oapi.dingtalk.com/robot/send?access_token=xxx", Secret("xxx"), ) if err := reporter.Report(context.Background(), NewMessage( NewMarkdown("title", `# title > references `), )); err != nil { log.Fatalf("report the message error: %s", err) }
Output:
type MessageOption ¶
type MessageOption func(o *MessageOptions)
func AtAll ¶
func AtAll() MessageOption
func AtMobiles ¶
func AtMobiles(mobiles ...string) MessageOption
func AtUserIds ¶
func AtUserIds(userIds ...string) MessageOption
type MessageOptions ¶
type MessageOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.