Documentation ¶
Index ¶
- Constants
- func BatchDeleteMessages(gs *GmailService, userId string, messageIds []string) error
- func DeleteMessagesFrom(gs *GmailService, rfc822s []string) (int, int, error)
- func GetLabelNames(client *http.Client) ([]string, error)
- func GetMessage(gs *GmailService, userId, messageId string) (*gmail.Message, error)
- func GetMessagesFrom(gs *GmailService, rfc822 string) (*gmail.ListMessagesResponse, error)
- func GetMessagesList(gs *GmailService, opts MessagesListOpts) (*gmail.ListMessagesResponse, error)
- func InflateMessages(gs *GmailService, userId string, msgMetas []*gmail.Message) ([]*gmail.Message, error)
- func NewUsersService(client *http.Client) (*gmail.UsersService, error)
- type GmailService
- type MessagesListOpts
- type MessagesListQueryOpts
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 GetMessage ¶
func GetMessage(gs *GmailService, userId, messageId string) (*gmail.Message, error)
func GetMessagesFrom ¶
func GetMessagesFrom(gs *GmailService, rfc822 string) (*gmail.ListMessagesResponse, error)
func GetMessagesList ¶
func GetMessagesList(gs *GmailService, opts MessagesListOpts) (*gmail.ListMessagesResponse, error)
func InflateMessages ¶
func InflateMessages(gs *GmailService, userId string, msgMetas []*gmail.Message) ([]*gmail.Message, error)
func NewUsersService ¶
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()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.