util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCron

func CheckCron(cronTab string) (string, error)

CheckCron 检查cron表达式是否正确

func Send

func Send(subject, content string) error

func SendMessage

func SendMessage(s Notice) error

Types

type EmailClient

type EmailClient struct {
	Type    string
	Message *Message
	SelfHostMail
	SendCloudMail
}

EmailClient 发送客户端

type Message

type Message struct {
	SelfHostFrom  string
	SendCloudFrom string
	FromName      string
	To            []string
	Cc            []string
	Subject       string
	ContentType   string
	Content       string
	Attach        string
}

Message 内容

type Notice

type Notice interface {
	SendMessage() error
}

type SelfHostMail

type SelfHostMail struct {
	Username string
	Password string
	Port     int
	Host     string
}

type SendCloudMail

type SendCloudMail struct {
	APIUser  string
	APIKey   string
	APIUrl   string
	Template string
}

type SendMail

type SendMail struct {
	Client *EmailClient
}

func NewSendMail

func NewSendMail(subject, content string) *SendMail

func (*SendMail) SendMessage

func (s *SendMail) SendMessage() error

type SendWeixin

type SendWeixin struct {
	Content string
}

func NewSendWeixin

func NewSendWeixin(content string) *SendWeixin

func (*SendWeixin) SendMessage

func (s *SendWeixin) SendMessage() error

Jump to

Keyboard shortcuts

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