notification

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(options PushNotification)

Types

type DingRobot

type DingRobot struct {
	DingUrl string
}

func (*DingRobot) Send

func (dingtalk *DingRobot) Send(result PushNotification) error

type DingRobotMarkdownTemplate

type DingRobotMarkdownTemplate struct{}

func (*DingRobotMarkdownTemplate) GenContent

func (temp *DingRobotMarkdownTemplate) GenContent(buf *bytes.Buffer, m PushNotification) string

func (*DingRobotMarkdownTemplate) GenFooter

func (*DingRobotMarkdownTemplate) GenSubject

func (temp *DingRobotMarkdownTemplate) GenSubject(buf *bytes.Buffer, m PushNotification) string

type Email

type Email struct {
	// contains filtered or unexported fields
}

func (*Email) Send

func (email *Email) Send(result PushNotification) error

type EmailTemplate

type EmailTemplate struct{}

func (*EmailTemplate) GenContent

func (temp *EmailTemplate) GenContent(buf *bytes.Buffer, m PushNotification) string

func (*EmailTemplate) GenFooter

func (temp *EmailTemplate) GenFooter(buf *bytes.Buffer, m PushNotification) string

func (*EmailTemplate) GenSubject

func (temp *EmailTemplate) GenSubject(buf *bytes.Buffer, m PushNotification) string

type INotify

type INotify interface {
	Send(m PushNotification) error
}

func DingRobotHandler

func DingRobotHandler(dingUrl string) INotify

func EmailHandler

func EmailHandler(host, user, password string, port int) INotify

func NewHandlers

func NewHandlers(notify *PushNotification) []INotify

type INotifyTemplate

type INotifyTemplate interface {
	GenSubject(buf *bytes.Buffer, m PushNotification) string
	GenContent(buf *bytes.Buffer, m PushNotification) string
	GenFooter(buf *bytes.Buffer, m PushNotification) string
}

type PushNotification

type PushNotification struct {
	// dingtalk
	DingURL    string
	DingEnable bool

	// email
	EmailEnable   bool
	EmailHost     string
	EmailPort     int
	EmailUser     string
	EmailPassword string

	// message
	StageName   string
	PublishName string
	StepName    string
	Status      int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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