gmailutil

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GmailDateFormat  = "2006/01/02"
	ReferenceURL     = "https://developers.google.com/gmail/api/v1/reference"
	TutorialURLGO    = "https://developers.google.com/gmail/api/quickstart/go"
	ListApiReference = "https://developers.google.com/gmail/api/v1/reference/users/messages/list"
	ListApiExample   = "https://stackoverflow.com/questions/43057478/google-api-go-client-listing-messages-w-label-and-fetching-header-fields"
	FilteringExample = "https://developers.google.com/gmail/api/guides/filtering"
	FilterRules      = "https://support.google.com/mail/answer/7190"

	CategoryForums     = "forums"
	CategoryPromotions = "promotions"
	CategorySocial     = "social"
	CategoryUpdates    = "updates"

	ExampleRule1 = "category:promotions older_than:2y"
	ExampleRule2 = "category:updates older_than:2y"
	ExampleRule3 = "category:social older_than:2y"
)

Variables

This section is empty.

Functions

func BatchDeleteMessages

func BatchDeleteMessages(gs *GmailService, userID string, messageIDs []string) error

func DeleteMessagesFrom

func DeleteMessagesFrom(gs *GmailService, rfc822s []string) (int, int, error)

func GetLabelNames

func GetLabelNames(client *http.Client) ([]string, error)

func GetMessage

func GetMessage(gs *GmailService, userId, messageId string) (*gmail.Message, error)

func GetMessagesFrom

func GetMessagesFrom(gs *GmailService, rfc822 string) (*gmail.ListMessagesResponse, error)

func InflateMessages

func InflateMessages(gs *GmailService, userId string, msgMetas []*gmail.Message) ([]*gmail.Message, error)

func NewUsersService

func NewUsersService(client *http.Client) (*gmail.UsersService, error)

Types

type GmailService

type GmailService struct {
	Service        *gmail.Service
	UsersService   *gmail.UsersService
	APICallOptions []googleapi.CallOption
	// contains filtered or unexported fields
}

func NewGmailService

func NewGmailService(client *http.Client) (*GmailService, error)

type MessagesListOpts

type MessagesListOpts struct {
	UserId               string
	IncludeSpamTrash     bool
	LabelIds             []string
	MaxResults           uint64
	PageToken            string
	Query                MessagesListQueryOpts
	Fields               []googleapi.Field
	IfNoneMatchEntityTag string
}

func (*MessagesListOpts) Condense

func (opts *MessagesListOpts) Condense()

func (*MessagesListOpts) Inflate

func (opts *MessagesListOpts) Inflate()

type MessagesListQueryOpts

type MessagesListQueryOpts struct {
	Category    string
	In          string
	From        string
	RFC822msgid string
	After       time.Time
	Before      time.Time
	OlderThan   string // #(mdy)
	NewerThan   string // #(mdy)
	Interval    timeutil.Interval
}

func (*MessagesListQueryOpts) Encode

func (opts *MessagesListQueryOpts) Encode() string

func (*MessagesListQueryOpts) TrimSpace

func (opts *MessagesListQueryOpts) TrimSpace()

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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