message

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Status      string            `json:"status"`
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
	StartsAt    time.Time         `json:"startsAt"`
	EndsAt      time.Time         `json:"endsAt"`
}

from prometheus model

type HuaweiSMN

type HuaweiSMN struct {
	Body []byte
}

func (HuaweiSMN) ConvertToMarkdown added in v0.1.0

func (smn HuaweiSMN) ConvertToMarkdown() (title, markdown string, err error)

type Message

type Message interface {
	ConvertToMarkdown() (title, markdown string, err error)
}

func CreateInterfaceMessage added in v0.1.0

func CreateInterfaceMessage(msgType string, body []byte) (msg Message, err error)

根据 msgType 初始化报警源结构体

type Notification

type Notification struct {
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
	Status            string            `json:"status"`
	Receiver          string            `json:"receiver"`
	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Alerts            []Alert           `json:"alerts"`
}

type Prom

type Prom struct {
	Body []byte
}

func (Prom) ConvertToMarkdown added in v0.1.0

func (prom Prom) ConvertToMarkdown() (title, markdown string, err error)

type Raw

type Raw struct {
	Body []byte
}

func (Raw) ConvertToMarkdown added in v0.1.0

func (raw Raw) ConvertToMarkdown() (title, markdown string, err error)

type SmnReqBody

type SmnReqBody struct {
	Type         string `json:"type"`
	Timestamp    string `json:"timestamp"`     // 消息第一次发送的时间戳
	SubscribeUrl string `json:"subscribe_url"` // 确认订阅消息
	Subject      string `json:"subject"`       // 推送消息标题
	Message      string `json:"message"`       // 消息详情
}

https://support.huaweicloud.com/usermanual-smn/smn_ug_a9002.html

Jump to

Keyboard shortcuts

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