notify

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxLineKey = util.CtxKey("ctxLineKey")
)
View Source
const (
	CtxMailKey = util.CtxKey("ctxMailKey")
)

Variables

This section is empty.

Functions

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

Types

type Line

type Line interface {
	SetLineBody(string)
	SendLine()
}

func GetLineByGin

func GetLineByGin(c *gin.Context) Line

type LineConf

type LineConf struct {
	Url         string `yaml:"notifyUrl"`
	AccessToken string `yaml:"token"`
}

func (*LineConf) NewLine

func (lc *LineConf) NewLine() Line

type LineDI

type LineDI interface {
	NewLine() Line
}

type Mail

type Mail interface {
	SetMailTitle(string)
	SetMailBody(string)
	SendMail()
}

func GetMailByGin

func GetMailByGin(c *gin.Context) Mail

type MailConf

type MailConf struct {
	UserName        string   `yaml:"username"`
	Server          string   `yaml:"server"`
	Port            int      `yaml:"port"`
	IsSSL           bool     `yaml:"ssl"`
	FromMailAccount string   `yaml:"from"`
	Password        string   `yaml:"password"`
	ToMailAccount   []string `yaml:"to"`
}

func (*MailConf) NewMail

func (mc *MailConf) NewMail() Mail

type MailDI

type MailDI interface {
	NewMail() Mail
}

type RequestBody

type RequestBody struct {
	Message string
}

Jump to

Keyboard shortcuts

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