cmd

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommand added in v0.8.0

func AddCommand(cmd *cobra.Command)

AddCommand adds a subcommand.

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func RemoveCommand added in v0.8.0

func RemoveCommand(name string) bool

RemoveCommand removes a subcommand.

Types

type APIKeyProvider added in v0.10.0

type APIKeyProvider interface {
	// APIKey returns the API key used to authenticate with GMail APIs.
	// Returns an empty string if not available.
	APIKey() string
}

APIKeyProvider is the interface implemented by API providers with an API key.

type GmailAPIProvider added in v0.10.0

type GmailAPIProvider interface {
	// Service returns the GMail API service.
	Service(ctx context.Context, cfgDir string) (*gmail.Service, error)
	// ResetConfig cleans up the configuration.
	ResetConfig(cfgDir string) error
	// InitConfig initializes the configuration.
	InitConfig(cfgDir string) error
}

GmailAPIProvider is the integration point between gmailctl commands and GMail APIs providers.

var APIProvider GmailAPIProvider

APIProvider is the APIProvider used by all gmailctl commands.

type TokenRefresher added in v0.10.1

type TokenRefresher interface {
	// RefreshToken refreshes the token if it is expired.
	RefreshToken(ctx context.Context, cfgDir string) error
}

TokenRefresher allows to refresh API tokens if they are expired.

Jump to

Keyboard shortcuts

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