gmail

package
v0.0.0-...-8bbec6b Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package gmail implements a SourceConnector for Gmail and Google Drive, providing read-only tools for searching emails, reading threads, searching Drive files, and reading document contents.

Gmail and Drive share the same Google OAuth token. The Gmail OAuth scopes should include drive.readonly for Drive tools to work.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

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

Connector implements source.SourceConnector for Gmail.

func New

func New(clientID, clientSecret string) *Connector

New creates a new Gmail source connector with OAuth credentials for token refresh.

func (*Connector) Execute

func (c *Connector) Execute(ctx context.Context, tool string, params map[string]any, token []byte) (map[string]any, error)

func (*Connector) Provider

func (c *Connector) Provider() string

func (*Connector) Tools

func (c *Connector) Tools() []source.ToolDefinition

func (*Connector) WithClientOption

func (c *Connector) WithClientOption(opt option.ClientOption) *Connector

WithClientOption returns a copy with a custom client option (for testing).

func (*Connector) WithTokenEndpoint

func (c *Connector) WithTokenEndpoint(tokenURL string) *Connector

WithTokenEndpoint returns a copy that uses the given URL for OAuth token refresh instead of Google's production endpoint. For testing only.

Jump to

Keyboard shortcuts

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