Versions in this module Expand all Collapse all v1 v1.5.0 Oct 12, 2026 Changes in this version + var Scopes = []string + type Attachment struct + ContentType string + Filename string + GmailAttachmentID string + Size int64 + type Client struct + func New(ctx context.Context, tokenSource oauth2.TokenSource, ...) (*Client, error) + func (c *Client) Compose(ctx context.Context, opts ComposeOptions) (string, error) + func (c *Client) CreateDraft(ctx context.Context, opts ComposeOptions) (Draft, error) + func (c *Client) CreateLabel(ctx context.Context, name string) (Label, error) + func (c *Client) DeleteDraft(ctx context.Context, draftID string) error + func (c *Client) DeleteLabel(ctx context.Context, id string) error + func (c *Client) FetchAttachment(ctx context.Context, messageID, attachmentID string) ([]byte, error) + func (c *Client) GetMessage(ctx context.Context, id string) (Message, error) + func (c *Client) GetProfile(ctx context.Context) (Profile, error) + func (c *Client) GetThread(ctx context.Context, threadID string) ([]Message, error) + func (c *Client) ListDrafts(ctx context.Context, maxResults int64) ([]Draft, error) + func (c *Client) ListLabels(ctx context.Context) ([]Label, error) + func (c *Client) MarkRead(ctx context.Context, id string) error + func (c *Client) MarkThreadRead(ctx context.Context, threadID string) error + func (c *Client) MarkThreadUnread(ctx context.Context, threadID string) error + func (c *Client) MarkUnread(ctx context.Context, id string) error + func (c *Client) ModifyLabels(ctx context.Context, id string, addLabelIds, removeLabelIds []string) error + func (c *Client) ModifyThreadLabels(ctx context.Context, threadID string, addLabelIds, removeLabelIds []string) error + func (c *Client) Reply(ctx context.Context, threadID, to, body string) (string, error) + func (c *Client) Search(ctx context.Context, query string, maxResults int64) ([]Message, error) + func (c *Client) Send(ctx context.Context, to []string, subject, body string) (string, error) + func (c *Client) SendDraft(ctx context.Context, draftID string) (string, error) + func (c *Client) Sync(ctx context.Context, cursor string) ([]Message, string, error) + func (c *Client) TrashMessage(ctx context.Context, id string) error + func (c *Client) TrashThread(ctx context.Context, threadID string) error + func (c *Client) UntrashMessage(ctx context.Context, id string) error + func (c *Client) UntrashThread(ctx context.Context, threadID string) error + type ComposeOptions struct + Bcc []string + Body string + Cc []string + Subject string + ThreadID string + To []string + type Draft struct + ID string + MessageID string + ThreadID string + type EmailAddress struct + Address string + Name string + type Label struct + ID string + Name string + type Message struct + Attachments []Attachment + BodyText string + From EmailAddress + ID string + LabelIds []string + SentAt time.Time + Subject string + ThreadID string + To EmailAddress + Unread bool + type Profile struct + EmailAddress string + MessagesTotal int64 + ThreadsTotal int64