gdrive

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeFolder      = "application/vnd.google-apps.folder"
	TypeGoogleSheet = "application/vnd.google-apps.spreadsheet"
)
View Source
const (
	GoogleDriveTimeFormat = "2006-01-02T15:04:05.000Z"
)

Variables

This section is empty.

Functions

func ExtractFileID

func ExtractFileID(driveLink string) (string, error)

Types

type GDrive

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

func NewGDrives

func NewGDrives(ctx context.Context, creds string, maxFileSizeSupportedMB, driveFileCleanupSizeLimitMB int) (*GDrive, error)

func (*GDrive) DownloadFile

func (gd *GDrive) DownloadFile(fileID string) ([]byte, error)

DownloadFile downloads a file from Google Drive

func (*GDrive) FolderListShow

func (gd *GDrive) FolderListShow(folderID string) (*drive.FileList, error)

func (*GDrive) GetLastModified

func (gd *GDrive) GetLastModified(url string) (*time.Time, error)

func (*GDrive) IsWithinDownloadLimit

func (gd *GDrive) IsWithinDownloadLimit(file *drive.File) bool

IsWithinDownloadLimit checks whether the given file's size is within the permissible download limit. Returns true if no limit is set or if the file size is below the configured maximum.

func (*GDrive) IsWithinParseLimit

func (gd *GDrive) IsWithinParseLimit(file *drive.File) bool

IsWithinParseLimit checks whether the given file's size is within the permissible parse limit. Returns true if no limit is set or if the file size is below the configured maximum.

func (*GDrive) ListDriveEntity

func (gd *GDrive) ListDriveEntity(url string) (string, *drive.File, error)

ListDriveEntity determines if a Google Drive link is a file or a directory

Jump to

Keyboard shortcuts

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