drive

package
v1.0.48 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package drive implements the gro drive command and subcommands.

Index

Constants

This section is empty.

Variables

View Source
var ClientFactory = func(ctx context.Context) (DriveClient, error) {
	return drive.NewClient(ctx)
}

ClientFactory is the function used to create Drive clients. Override in tests to inject mocks.

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand returns the drive parent command with subcommands

Types

type DriveClient added in v1.0.35

type DriveClient interface {
	ListFiles(ctx context.Context, query string, pageSize int64) ([]*drive.File, error)
	ListFilesWithScope(ctx context.Context, query string, pageSize int64, scope drive.DriveScope) ([]*drive.File, error)
	GetFile(ctx context.Context, fileID string) (*drive.File, error)
	DownloadFile(ctx context.Context, fileID string) ([]byte, error)
	ExportFile(ctx context.Context, fileID string, mimeType string) ([]byte, error)
	ListSharedDrives(ctx context.Context, pageSize int64) ([]*drive.SharedDrive, error)
	StarFile(ctx context.Context, fileID string) error
	UnstarFile(ctx context.Context, fileID string) error
	SearchFileIDs(ctx context.Context, query string, pageSize int64) ([]string, error)
}

DriveClient defines the interface for Drive client operations used by drive commands.

type TreeNode added in v1.0.24

type TreeNode struct {
	ID       string      `json:"id"`
	Name     string      `json:"name"`
	Type     string      `json:"type"`
	Children []*TreeNode `json:"children,omitempty"`
}

TreeNode represents a node in the folder tree

Jump to

Keyboard shortcuts

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