alert

package
v0.0.0-...-012d1c6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(a Alert)

需要启动时注册,无锁,非线程安全

func Send

func Send(event *Event) error

发送消息

Types

type Alert

type Alert interface {
	Name() string
	Send(event *Event) error
}

type Event

type Event struct {
	Tag   string    // 用于标识使用哪个组
	Type  EventType // 消息类型
	Title string    // 标题,大部分没有
	Text  string    // 内容,必须有
	Meta  map[string]interface{}
}

type EventType

type EventType string
const (
	TextEvent EventType = "text"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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