monitor

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DingTalk

type DingTalk struct {
	Handler
	Url string `json:"url"`
	// contains filtered or unexported fields
}

func NewDingTalk

func NewDingTalk(url string) *DingTalk

@desc @auth liuguoqiang 2020-12-07 @param @return

func (*DingTalk) SendMsg

func (dingTalk *DingTalk) SendMsg(body interface{}) ([]byte, error)

@desc 发送钉钉消息 @auth liuguoqiang 2020-12-07 @param @return

func (*DingTalk) SendTextMsg

func (dingTalk *DingTalk) SendTextMsg(content string) error

@desc 发送钉钉文本消息 @auth liuguoqiang 2020-12-07 @param @return

func (*DingTalk) WithAtMobiles

func (dingTalk *DingTalk) WithAtMobiles(atMobiles []string) *DingTalk

@desc @部分成员 @auth liuguoqiang 2020-12-07 @param @return

func (*DingTalk) WithIsAtAll

func (dingTalk *DingTalk) WithIsAtAll(isAtAll bool) *DingTalk

@desc @所有成员 @auth liuguoqiang 2020-12-07 @param @return

type Handler

type Handler interface {
	SendTextMsg(content string) error
}

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(handlerList ...Handler) *Monitor

@desc @auth liuguoqiang 2020-12-07 @param @return

func (*Monitor) Close

func (monitor *Monitor) Close(timeout int64)

@desc 程序退出前阻塞直到将数据发送出去,或者超时 @auth liuguoqiang 2020-12-07 @param @return

func (*Monitor) SendTextMsg

func (monitor *Monitor) SendTextMsg(content string) error

@desc 发送本消息 @auth liuguoqiang 2020-12-07 @param @return

type TextMsg

type TextMsg struct {
	Msgtype string `json:"msgtype"`
	Text    struct {
		Content string `json:"content"`
	} `json:"text"`
	At struct {
		AtMobiles []string `json:"atMobiles"`
		IsAtAll   bool     `json:"isAtAll"`
	} `json:"at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL