Documentation ¶
Index ¶
- func GetFolderID(service *drive.Service, folderName string) (string, error)
- func GetService(pathToCredentialsJSON string, pathToTokenJSON string, scopes ...string) (*drive.Service, error)
- func UploadFileToFolder(service *drive.Service, folderID string, name string, mimeType string, ...) (*drive.File, error)
- func UploadFileToRoot(service *drive.Service, name string, mimeType string, content io.Reader) (*drive.File, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFolderID ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.