alert

package
v5.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: AGPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RecipientTypes 收信类型
	RecipientTypes = echo.NewKVData()

	// RecipientPlatforms 收信平台
	RecipientPlatforms             = echo.NewKVData()
	RecipientPlatformWebhookCustom = `custom`

	// Topics 告警专题
	Topics = echo.NewKVData()
)
View Source
var SendTopic = func(_ echo.Context, topic string, _ *AlertData) error {
	return nil
}

Functions

This section is empty.

Types

type AlertData

type AlertData struct {
	Title   string
	Content ContentType
	Data    param.Store
}

func NewData

func NewData(title string, ct ContentType) *AlertData

type ContentType

type ContentType interface {
	EmailContent(params param.Store) []byte
	MarkdownContent(params param.Store) []byte
}

ContentType 消息内容类型

type WebhookCustom

type WebhookCustom struct {
	Name    string
	Method  string
	Url     string
	Content string
	Headers []string
}

func NewWebhookCustom

func NewWebhookCustom() *WebhookCustom

func (*WebhookCustom) Descriptions

func (w *WebhookCustom) Descriptions() []string

func (*WebhookCustom) ToWebhook

func (w *WebhookCustom) ToWebhook() *webhook.Webhook

Jump to

Keyboard shortcuts

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