msg

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenSign

func GenSign(secret string, timestamp int64) string

func NewMsgRepo

func NewMsgRepo(data *data.Data, logger log.Logger) repository.MsgRepo

Types

type DingDingHookResp

type DingDingHookResp struct {
	ErrCode int64  `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

func (*DingDingHookResp) Error

func (l *DingDingHookResp) Error() string

type FeiShuHookResp

type FeiShuHookResp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

func (*FeiShuHookResp) Error

func (l *FeiShuHookResp) Error() string

type HookNotify

type HookNotify interface {
	// Alarm 告警通知接口
	Alarm(ctx context.Context, url string, msg *HookNotifyMsg) error
}

func NewDingNotify

func NewDingNotify() HookNotify

func NewFeishuNotify

func NewFeishuNotify() HookNotify

func NewHookNotify

func NewHookNotify(app vobj.NotifyApp) HookNotify

func NewOtherNotify

func NewOtherNotify() HookNotify

func NewWechatNotify

func NewWechatNotify() HookNotify

type HookNotifyMsg

type HookNotifyMsg struct {
	Content   string      `json:"content"`
	AlarmInfo *bo.AlertBo `json:"-"`
	Secret    string      `json:"-"`
}

type WechatHookResp

type WechatHookResp struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

func (*WechatHookResp) Error

func (l *WechatHookResp) Error() string

type WechatMarkdown

type WechatMarkdown struct {
	Content string `json:"content"`
}

type WechatMsg

type WechatMsg struct {
	MsgType  string         `json:"msgtype"`
	Markdown WechatMarkdown `json:"markdown"`
}

func (*WechatMsg) Bytes

func (v *WechatMsg) Bytes() []byte

Bytes WechatMsg to bytes

Jump to

Keyboard shortcuts

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