cmd

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TrootCmd = &cobra.Command{
	Use: "keep-online", Short: "Keep online commands",
	Run: func(cmd *cobra.Command, args []string) {
		if s, err := cmd.Flags().GetString("config"); err != nil {
			Logger.Sugar().Error(err.Error())
		} else {
			inputConfigFilePath = s
		}
		Logger.Sugar().Infof("config file path: %s", inputConfigFilePath)
	},
}

Functions

func CustomerImapClient added in v1.0.5

func CustomerImapClient(name, password, server string) (*client.Client, error)

CustomerImapClient 调用NewImapClient

func NewImapClient added in v1.0.5

func NewImapClient(username, password, server string) (*client.Client, error)

NewImapClient 创建IMAP客户端

func Usage added in v1.0.5

func Usage(cmail config.Mail)

Usage 【处理业务需求】假设需求是找出求以subject开头的标题的最新邮件,并下载附件。 【思路】有些邮件包含附件后会变得特别大,如果要遍历的邮件很多,直接遍历处理,每封邮件都获取'RFC822'内容, fetch方法执行耗时可能会很长, 因此可以分两次fetch处理,减少处理时长: 1)第一次fetch先使用ENVELOP或者RFC822.HEADER获取邮件头信息找到满足业务需求邮件的id 2)第二次fetch根据这个邮件id使用'RFC822'获取邮件MIME内容,下载附件

Types

This section is empty.

Jump to

Keyboard shortcuts

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