alarmx

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

README

告警处理程序

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DingCh = make(chan *AlarmData, 10)

Functions

func InitDing

func InitDing(key, host string)

func SendDing

func SendDing(d *AlarmData)

Types

type AlarmAt

type AlarmAt struct {
	AtMobiles []string `json:"atMobiles"`
	IsAtAll   bool     `json:"isAtAll"`
}

type AlarmContext

type AlarmContext struct {
}

AlarmContext alarm

func (*AlarmContext) Alarm

func (ctx *AlarmContext) Alarm(name string)

type AlarmData

type AlarmData struct {
	Title       string                 //报警标题
	Description string                 //报警描述
	Content     map[string]interface{} //kv数据
}

func (*AlarmData) SendAlarm

func (ad *AlarmData) SendAlarm() error

type AlarmMarkdown

type AlarmMarkdown struct {
	Title string `json:"title"`
	Text  string `json:"text"`
}

type AlarmMsg

type AlarmMsg struct {
	MsgType  string        `json:"msgtype"`
	Text     AlarmText     `json:"text"`
	Markdown AlarmMarkdown `json:"markdown"`
	At       AlarmAt       `json:"at"`
}

type AlarmText

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

type AlarmsContext

type AlarmsContext interface {
	Alarm(name string)
}

AlarmsContext 链路

Jump to

Keyboard shortcuts

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