Documentation
¶
Overview ¶
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Package gsmdrive implements the Drive API Copyright © 2020 Hannes Hayashi
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- func CopyFile(fileID, includePermissionsForView, ocrLanguage, fields string, ...) (*drive.File, error)
- func CopyFolders(folderMap map[string]*Folder, destination string) error
- func CreateComment(fileID, fields string, comment *drive.Comment) (*drive.Comment, error)
- func CreateDrive(d *drive.Drive, fields string) (*drive.Drive, error)
- func CreateFile(file *drive.File, content *os.File, ...) (*drive.File, error)
- func CreatePermission(fileID, emailMessage, fields string, ...) (*drive.Permission, error)
- func CreateReply(fileID, commentID, fields string, reply *drive.Reply) (*drive.Reply, error)
- func DeleteComment(fileID, commentID string) (bool, error)
- func DeleteDrive(driveID string) (bool, error)
- func DeleteFile(fileID string) (bool, error)
- func DeletePermission(fileID, permissionID string, useDomainAdminAccess bool) (bool, error)
- func DeleteReply(fileID, commentID, replyID string) (bool, error)
- func DeleteRevision(fileID, revisionID string) (bool, error)
- func DownloadFile(fileID string, acknowledgeAbuse bool) (string, error)
- func DownloadRevision(fileID, revisionID string, acknowledgeAbuse bool) (string, error)
- func EmptyTrash() (bool, error)
- func ExportFile(fileID, mimeType string) (string, error)
- func GenerateFileIDs(count int64, space string) ([]string, error)
- func GetAbout(fields string) (*drive.About, error)
- func GetComment(fileID, commentID, fields string, includeDeleted bool) (*drive.Comment, error)
- func GetDrive(driveID, fields string, useDomainAdminAccess bool) (*drive.Drive, error)
- func GetFile(fileID, fields, includePermissionsForView string) (*drive.File, error)
- func GetFilesAndFolders(folderID string, threads int) (folderMap map[string]*Folder, files []*drive.File, err error)
- func GetPermission(fileID, permissionID, fields string, useDomainAdminAccess bool) (*drive.Permission, error)
- func GetReply(fileID, commentID, replyID, fields string, includeDeleted bool) (*drive.Reply, error)
- func GetRevision(fileID, revisionID, fields string) (*drive.Revision, error)
- func GetStartPageToken(driveID, fields string) (*drive.StartPageToken, error)
- func HideDrive(driveID, fields string) (*drive.Drive, error)
- func IsFolder(f *drive.File) bool
- func ListChanges(pageToken, driveID, spaces, fields, includePermissionsForView string, ...) ([]*drive.Change, string, error)
- func ListComments(fileID, startModifiedTime, fields string, includeDeleted bool) ([]*drive.Comment, error)
- func ListDrives(filter, fields string, useDomainAdminAccess bool) ([]*drive.Drive, error)
- func ListFiles(q, driveID, corpora, includePermissionsForView, orderBy, spaces, fields string, ...) ([]*drive.File, error)
- func ListFilesRecursive(id, fields string, threads int) ([]*drive.File, error)
- func ListPermissions(fileID, includePermissionsForView, fields string, useDomainAdminAccess bool) ([]*drive.Permission, error)
- func ListReplies(fileID, commentID, fields string, includeDeleted bool) ([]*drive.Reply, error)
- func ListRevisions(fileID, fields string) ([]*drive.Revision, error)
- func SetClient(c *http.Client)
- func UnhideDrive(driveID, fields string) (*drive.Drive, error)
- func UpdateComment(fileID, commentID, fields string, comment *drive.Comment) (*drive.Comment, error)
- func UpdateDrive(driveID, fields string, useDomainAdminAccess bool, d *drive.Drive) (*drive.Drive, error)
- func UpdateFile(...) (*drive.File, error)
- func UpdatePermission(fileID, permissionID, fields string, ...) (*drive.Permission, error)
- func UpdateReply(fileID, commentID, replyID, fields string, reply *drive.Reply) (*drive.Reply, error)
- func UpdateRevision(fileID, revisionID, fields string, revision *drive.Revision) (*drive.Revision, error)
- type Folder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
func CopyFile(fileID, includePermissionsForView, ocrLanguage, fields string, file *drive.File, ignoreDefaultVisibility, keepRevisionForever bool) (*drive.File, error)
CopyFile creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied.
func CopyFolders ¶
CopyFolders creates a copy of a Drive folder structure at a new destination
func CreateComment ¶
CreateComment creates a new comment on a file.
func CreateDrive ¶
CreateDrive creates a new shared drive.
func CreateFile ¶
func CreateFile(file *drive.File, content *os.File, ignoreDefaultVisibility, keepRevisionForever, useContentAsIndexableText bool, includePermissionsForView, ocrLanguage, fields string) (*drive.File, error)
CreateFile creates a new file.
func CreatePermission ¶
func CreatePermission(fileID, emailMessage, fields string, useDomainAdminAccess, sendNotificationEmail, transferOwnership, moveToNewOwnersRoot bool, permission *drive.Permission) (*drive.Permission, error)
CreatePermission creates a permission for a file or shared drive.
func CreateReply ¶
CreateReply creates a new reply to a comment.
func DeleteComment ¶
DeleteComment deletes a comment.
func DeleteDrive ¶
DeleteDrive permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.
func DeleteFile ¶
DeleteFile permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.
func DeletePermission ¶
DeletePermission deletes a permission.
func DeleteReply ¶
DeleteReply deletes a reply.
func DeleteRevision ¶
DeleteRevision permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.
func DownloadFile ¶
DownloadFile downloads a file from drive
func DownloadRevision ¶
DownloadRevision downloads a file revision from drive
func EmptyTrash ¶
EmptyTrash permanently deletes all of the user's trashed files.
func ExportFile ¶
ExportFile exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.
func GenerateFileIDs ¶
GenerateFileIDs generates a set of file IDs which can be provided in create or copy requests.
func GetAbout ¶
GetAbout gets information about the user, the user's Drive, and system capabilities.
func GetComment ¶
GetComment gets a comment by ID.
func GetFilesAndFolders ¶
func GetFilesAndFolders(folderID string, threads int) (folderMap map[string]*Folder, files []*drive.File, err error)
GetFilesAndFolders recursively gets all files and folders below a parent folder and separates them, returning a map[string]*folder for folders and a simple list for files.
func GetPermission ¶
func GetPermission(fileID, permissionID, fields string, useDomainAdminAccess bool) (*drive.Permission, error)
GetPermission gets a permission by ID.
func GetRevision ¶
GetRevision gets a revision's metadata or content by ID.
func GetStartPageToken ¶
func GetStartPageToken(driveID, fields string) (*drive.StartPageToken, error)
GetStartPageToken gets the starting pageToken for listing future changes.
func IsFolder ¶
IsFolder returns true if the file object is a folder, otherwise false Make sure that the MimeType property is actually set.
func ListChanges ¶
func ListChanges(pageToken, driveID, spaces, fields, includePermissionsForView string, includeCorpusRemovals, includeItemsFromAllDrives, includeRemoved, restrictToMyDrive bool) ([]*drive.Change, string, error)
ListChanges lists the changes for a user or shared drive.
func ListComments ¶
func ListComments(fileID, startModifiedTime, fields string, includeDeleted bool) ([]*drive.Comment, error)
ListComments lists a file's comments.
func ListDrives ¶
ListDrives lists the user's shared drives. This method accepts the q parameter, which is a search query combining one or more search terms. For more information, see https://developers.google.com/drive/api/v3/search-shareddrives.
func ListFiles ¶
func ListFiles(q, driveID, corpora, includePermissionsForView, orderBy, spaces, fields string, includeItemsFromAllDrives bool) ([]*drive.File, error)
ListFiles lists or searches files. This method accepts the q parameter, which is a search query combining one or more search terms. For more information, see https://developers.google.com/drive/api/v3/search-files.
func ListFilesRecursive ¶
ListFilesRecursive lists all files and foldes in a parent folder recursively
func ListPermissions ¶
func ListPermissions(fileID, includePermissionsForView, fields string, useDomainAdminAccess bool) ([]*drive.Permission, error)
ListPermissions lists a file's or shared drive's permissions.
func ListReplies ¶
ListReplies Lists a comment's replies.
func ListRevisions ¶
ListRevisions lists a file's revisions.
func UnhideDrive ¶
UnhideDrive restores a shared drive to the default view.
func UpdateComment ¶
func UpdateComment(fileID, commentID, fields string, comment *drive.Comment) (*drive.Comment, error)
UpdateComment updates a comment with patch semantics.
func UpdateDrive ¶
func UpdateDrive(driveID, fields string, useDomainAdminAccess bool, d *drive.Drive) (*drive.Drive, error)
UpdateDrive updates the metadate for a shared drive.
func UpdateFile ¶
func UpdateFile(fileID, addParents, removeParents, includePermissionsForView, ocrLanguage, fields string, file *drive.File, content *os.File, keepRevisionForever, useContentAsIndexableText bool) (*drive.File, error)
UpdateFile updates a file's metadata and/or content. This method supports patch semantics.
func UpdatePermission ¶
func UpdatePermission(fileID, permissionID, fields string, useDomainAdminAccess, removeExpiration bool, permission *drive.Permission) (*drive.Permission, error)
UpdatePermission updates a permission with patch semantics.