gdriveutil

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFolderID

func GetFolderID(service *drive.Service, folderName string) (string, error)

GetFolderID attempts to find a Google Drive folder by name and retrieve its ID. If there are multiple folders with the same name, an error is returned.

func GetService

func GetService(pathToCredentialsJSON string, pathToTokenJSON string, scopes ...string) (*drive.Service, error)

GetService returns a Google Drive v3 API service based on given app credentials, OAuth2 token and scopes. If the token file does not exist, a browser tab with Google's authorization flow will be opened.

func UploadFileToFolder

func UploadFileToFolder(service *drive.Service, folderID string, name string, mimeType string, content io.Reader) (*drive.File, error)

UploadFileToFolder uploads a file to the specified Google Drive folder.

func UploadFileToRoot

func UploadFileToRoot(service *drive.Service, name string, mimeType string, content io.Reader) (*drive.File, error)

UploadFileToRoot uploads a file to the root Google Drive folder.

Types

This section is empty.

Jump to

Keyboard shortcuts

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