chudrive

package
v0.0.0-...-3521f82 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: MIT Imports: 5 Imported by: 0

README

chudrive

chudrive provides common functions to access google drive

How to use

// upload
_, err := chudriveWrapper.UploadFileLocal(filename, filePathID)

// download
err := chudriveWrapper.DownloadFileLocal(filename, fileID)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chudrive

type Chudrive struct {
	Drive *drive.Service
}

Chudrive - Google drive wrapper.

func (*Chudrive) CreateFolder

func (chudrive *Chudrive) CreateFolder(folderName, parentID string) (*drive.File, error)

CreateFolder - Create a folder.

func (*Chudrive) DeleteFile

func (chudrive *Chudrive) DeleteFile(fileID string) error

DeleteFile - Delete file.

func (*Chudrive) DownloadFileLocal

func (chudrive *Chudrive) DownloadFileLocal(filename, fileID string) error

DownloadFileLocal - Download file to local.

func (*Chudrive) ListByQuery

func (chudrive *Chudrive) ListByQuery(query string) (map[string]string, error)

ListByQuery - List everything by query.

func (*Chudrive) ListFile

func (chudrive *Chudrive) ListFile(query string) (map[string]string, error)

ListFile - List file, it is super weird, google treats directory as files too.

func (*Chudrive) ListFolder

func (chudrive *Chudrive) ListFolder(query string) (map[string]string, error)

ListFolder - List folder.

func (*Chudrive) TransferOwnership

func (chudrive *Chudrive) TransferOwnership(fileID, email string) error

TransferOwnership - Transfer ownership. This is particularly useful when you are using service account to create. Please make sure you own whatever file instead of your service account!

func (*Chudrive) UploadFileLocal

func (chudrive *Chudrive) UploadFileLocal(filename, parentID string) (*drive.File, error)

UploadFileLocal - Upload file to path.

Jump to

Keyboard shortcuts

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