svc

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Creds []byte

Functions

func ExportMessages

func ExportMessages(
	msgs chan *gmail.Message, total int64, pui *ui.ProgressUI,
	saveMsgAttachments SaveMsgAttachments,
	saveEml SaveEml, NoHtmlBody bool, NoTextBody bool) *excelize.File

func GetClient

func GetClient(config *oauth2.Config, TokenFile string, BatchMode bool, NoBrowser bool, NoTokenSave bool) *http.Client

Retrieve a token, saves the token, then returns the generated client.

func GetGmailSrv

func GetGmailSrv(TokenFile string, BatchMode bool, NoBrowser bool, NoTokenSave bool) (*gmail.Service, error)

func GetLabelsByIdOrName added in v0.0.2

func GetLabelsByIdOrName(srv *gmail.Service, user string, refs ...string) ([]*gmail.Label, error)

func GetMessages

func GetMessages(srv *gmail.Service, messagesLimit int, pui *ui.ProgressUI, user string, pageSize int64, pageLimit int64, labelRefs ...string) (chan *gmail.Message, int64)

func ListLabels

func ListLabels(srv *gmail.Service, user string) ([]*gmail.Label, error)

func RemoveNils added in v0.0.2

func RemoveNils[C any | string](s []*C) []*C

func SaveMessageFile added in v0.0.4

func SaveMessageFile(srv *gmail.Service, MessagesDir string, MessagesSeed *[]int32, user string, msgId string) (string, error)

Types

type LocalAttachment

type LocalAttachment struct {
	Filename string
}

func SaveAttachments

func SaveAttachments(srv *gmail.Service, rateLimiter ratelimit.Limiter, AttachmentsDir string, AttachmentsSeed *[]int32, user string, message *gmail.Message) ([]*LocalAttachment, error)

type SaveEml added in v0.0.4

type SaveEml func(*gmail.Message) (string, error)

type SaveMsgAttachments

type SaveMsgAttachments func(*gmail.Message) ([]*LocalAttachment, error)

Jump to

Keyboard shortcuts

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