notify

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-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 BaseNotifier

type BaseNotifier struct {
	Meta                  map[string]interface{}
	LeftDelim, RightDelim string
}

notifier基础类

func (*BaseNotifier) AddMeta

func (n *BaseNotifier) AddMeta(key string, val interface{})

func (*BaseNotifier) GetDelims

func (n *BaseNotifier) GetDelims() (left, right string)

func (*BaseNotifier) GetMeta

func (n *BaseNotifier) GetMeta() map[string]interface{}

func (*BaseNotifier) SetDelims

func (n *BaseNotifier) SetDelims(left, right string)

type EmailConfig

type EmailConfig struct {
	BaseNotifier
	//邮件服务器配置
	Host, User, Password string
	Port                 int
	//发送者和接收者邮箱信息
	From, To, CC string

	//主题
	Subject string
	//附件
	Attach string
	// 发送内容
	Body struct {
		ContentType string
		Content     string
		Cmd         map[string]string
	}
}

邮件配置

func (*EmailConfig) Notify

func (e *EmailConfig) Notify() error

type Notifier

type Notifier interface {
	//通知
	Notify() error
	//添加元数据 用于渲染发送内容
	AddMeta(key string, val interface{})
	//查看元数据
	GetMeta() map[string]interface{}
}

通知接口

Jump to

Keyboard shortcuts

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