gcloud

package
v0.0.0-...-95c80d3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthHelper

func AuthHelper(redirectPath string, redirectPort int, conf *Config) error

func RefreshAccessToken

func RefreshAccessToken(conf *Config) (*oauth2.Token, error)

func SaveToken

func SaveToken(path string, token *oauth2.Token) error

Saves a token to a file path.

Types

type Config

type Config struct {
	CredFilename  string
	TokenFilename string
	RefreshToken  bool
}

type DriveClient

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

func CreateDriveClient

func CreateDriveClient(conf *Config) (*DriveClient, error)

func (*DriveClient) CreateFile

func (c *DriveClient) CreateFile(filename, parentFolderID string, r io.Reader, modTime time.Time) (string, error)

func (*DriveClient) GetAndCreateFileIDIfNotExist

func (c *DriveClient) GetAndCreateFileIDIfNotExist(filename, parentFolderID string, r io.Reader, modTime time.Time) (bool, string, error)

func (*DriveClient) GetFile

func (c *DriveClient) GetFile(fileID string) (io.ReadCloser, error)

func (*DriveClient) GetFileID

func (c *DriveClient) GetFileID(filename, parentFolderID string) (string, string, error)

func (*DriveClient) ListFiles

func (c *DriveClient) ListFiles(folderID string) ([]*types.DirInfo, []*types.FileInfo, error)

func (*DriveClient) UpdateFileMetadata

func (c *DriveClient) UpdateFileMetadata(fileID string, metadata map[string]string) error

Jump to

Keyboard shortcuts

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