gsuite

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Config *config.Config
	Out    io.Writer
	TS     oauth2.TokenSource
}

App is a struct that provides routines for configuring the application. It provides common application logic across subcommands.

func NewApp

func NewApp(out io.Writer) *App

func (*App) LoadConfig

func (a *App) LoadConfig(cmd *cobra.Command) error

LoadConfig loads the config. It takes an optional command. The command allows values to be overwritten from the CLI.

func (*App) SetupLogging

func (a *App) SetupLogging(logToFile bool) error

func (*App) SetupTokenSource

func (a *App) SetupTokenSource() error

type Drive

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

func NewDrive

func NewDrive(cfg config.Config, ts oauth2.TokenSource) (*Drive, error)

func (*Drive) ImportToGoogleDoc

func (d *Drive) ImportToGoogleDoc(ctx context.Context, htmlFilePath, docTitle string, folderID string) (string, error)

func (*Drive) Search

func (d *Drive) Search(ctx context.Context, query string, maxResults int64, pageToken string) ([]*drive.File, error)

Search Google Drive. Important: The query syntax used by the API isn't quite the same as that used in the UI. https://docs.google.com/document/d/196tomkYJloQcsVUsS19ozn2F67UiIUVGFwDL9OusYyM/edit This currently searches the user corpora.

type Email

type Email struct {
	ID      string
	From    string
	To      string
	Subject string
	Body    string
	Date    time.Time
}

type EmailInfo

type EmailInfo struct {
	ID      string
	From    string
	To      string
	Subject string
	Snippet string
	Date    time.Time
}

type Inbox

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

Inbox is a struct that provides routines for interacting with your inbox.

func NewInbox

func NewInbox(cfg config.Config, ts oauth2.TokenSource) (*Inbox, error)

func (*Inbox) GetMessage

func (i *Inbox) GetMessage(ctx context.Context, messageID string) (*Email, error)

func (*Inbox) Search

func (i *Inbox) Search(ctx context.Context, query string, maxResults int64, pageToken string) ([]*EmailInfo, error)

Jump to

Keyboard shortcuts

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