pushes

package
v0.0.0-...-65d0321 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendMail

func SendMail(host string, port int, from, to, subject, pwd string, body string, filename ...string)

Types

type Attachment

type Attachment struct {
	Type     ContentType //类型
	Name     string      //显示用的名称
	FileName string      //真实文件地址
}

附件

func (*Attachment) Write

func (this *Attachment) Write(boundary string, buffer *bytes.Buffer)

写入附件的头及文件内容(使用base64)

type ContentType

type ContentType string

内容类型:包括html\plain\

const (
	CT_HTML ContentType = "html"
	CT_TEXT ContentType = "plain"
)

func (ContentType) ToString

func (this ContentType) ToString() string

type EmailMessage

type EmailMessage struct {
	Type    ContentType
	Charset string   //字符编码
	From    string   //发件人
	To      []string //接收者
	Cc      []string //接收者
	Bcc     []string //接收者
	Subject string   //标题
	Body    string   //邮件内容
	// contains filtered or unexported fields
}

邮件

func (*EmailMessage) AddAttachment

func (this *EmailMessage) AddAttachment(a Attachment)

增加附件

func (*EmailMessage) ToByte

func (this *EmailMessage) ToByte() []byte

生成邮件发送格式体

type KindlePusher

type KindlePusher struct {
	Pm       *PusherManager         `Inject:""`
	Captions collect.CaptionManager `Inject:""`
	PortStr  string                 `Value:"kindle.port"`
	Out      string                 `Value:"out.dir"`
	Size     int                    `Value:"out.size"`

	Host       string `Value:"kindle.host"`
	Account    string `Value:"kindle.account"` //mail 账户
	Accountpwd string `Value:"kindle.pwd"`     //发送密码
	// contains filtered or unexported fields
}

kindle

func (*KindlePusher) Execute

func (this *KindlePusher) Execute(profile *profiles.Profile)

推送

func (*KindlePusher) Init

func (this *KindlePusher) Init()

type Pusher

type Pusher interface {
	//执行推送
	//推送内容标题,文件列表
	Execute(p *profiles.Profile)
}

pusher 接口定义

type PusherManager

type PusherManager struct {
	CatalogStr string `Value:"profile.catalog"`

	P profiles.ProfileManager `Inject:""`
	// contains filtered or unexported fields
}

func (*PusherManager) Add

func (this *PusherManager) Add(name string, p Pusher)

注册pusher处理器

func (*PusherManager) Get

func (this *PusherManager) Get(rt string) Pusher

获取推送器

func (*PusherManager) Init

func (this *PusherManager) Init()

func (*PusherManager) PushCronHandler

func (this *PusherManager) PushCronHandler()

推送定时job的处理函数

type SmtpClient

type SmtpClient struct {
	Host string
	User string
	Pwd  string
	Port int
	// contains filtered or unexported fields
}

smtp客户端,完成登录及发送邮件

func (*SmtpClient) SendMessage

func (this *SmtpClient) SendMessage(m *EmailMessage) bool

发送邮件

Jump to

Keyboard shortcuts

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