gmail

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package gmail implements mail.Provider against the Gmail API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Gmail-backed mail.Provider.

func New

func New(ctx context.Context, ts oauth2.TokenSource) (*Client, error)

New builds a client from a refreshing token source and resolves the authenticated address.

func (*Client) Account

func (c *Client) Account() string

Account returns the authenticated address.

func (*Client) Attachment

func (c *Client) Attachment(ctx context.Context, msgID, attachmentID string) ([]byte, error)

Attachment fetches attachment content on demand.

func (*Client) Labels

func (c *Client) Labels(ctx context.Context) ([]mail.Label, error)

Labels lists mailboxes and tags with their unread counts. The list endpoint omits counts, so each label is fetched concurrently to fill them in.

func (*Client) Modify

func (c *Client) Modify(ctx context.Context, threadIDs []string, add, remove []string) error

Modify applies a label delta to whole threads.

func (*Client) Name

func (c *Client) Name() string

Name identifies the service.

func (*Client) Send

func (c *Client) Send(ctx context.Context, d mail.Draft) error

Send delivers a draft, threading it when the draft carries reply metadata.

func (*Client) Thread

func (c *Client) Thread(ctx context.Context, id string) ([]mail.Message, error)

Thread returns every message in a conversation, oldest first.

func (*Client) Threads

func (c *Client) Threads(ctx context.Context, q mail.ThreadQuery) (mail.ThreadPage, error)

Threads returns one page of conversation summaries.

Jump to

Keyboard shortcuts

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