src

package
v0.0.0-...-f7f54a0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	URL         = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="
	OKMsg       = "告警恢复"
	AlertingMsg = "触发告警"
	OK          = "OK"
	Alerting    = "Alerting"
	ColorGreen  = "info"
	ColorGray   = "comment"
	ColorRed    = "warning"
)

Variables

This section is empty.

Functions

func MsgMarkdown

func MsgMarkdown(h *Hook, color string) string

MsgMarkdown 发送消息类型

func MsgNews

func MsgNews(h *Hook) string

MsgNews 发送消息类型 news

func SendCard

func SendCard(c *fiber.Ctx) error

func SendImageMsg

func SendImageMsg(c *fiber.Ctx) error

func SendImg

func SendImg(botKey, title string, lines ...string) error

SendImg 发送图片

func SendMsg

func SendMsg(botKey, title, warn, msg, comment string) error

SendMsg 发送消息 botKey 机器人的Key

Types

type EvalMatche

type EvalMatche struct {
	Metric Metric                 `json:"metric"`
	Tags   map[string]interface{} `json:"tags"`
	Value  float64                `json:"value"`
}

type Hook

type Hook struct {
	DashboardId float64                  `json:"dashboardId"`
	EvalMatches []map[string]interface{} `json:"evalMatches"`
	ImageUrl    string                   `json:"imageUrl"`
	Message     string                   `json:"message"`
	OrgId       float64                  `json:"orgId"`
	PanelId     float64                  `json:"panelId"`
	RuleId      float64                  `json:"ruleId"`
	RuleName    string                   `json:"ruleName"`
	RuleUrl     string                   `json:"ruleUrl"`
	State       string                   `json:"state"`
	Tags        map[string]interface{}   `json:"tags"`
	Title       string                   `json:"title"`
}

type Metric

type Metric struct {
	Instance string `json:"instance"`
	Job      string `json:"job"`
}

Jump to

Keyboard shortcuts

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