Documentation ¶
Index ¶
- Variables
- func ByteCount(b int64) string
- func GetFileIdFromUrl(url string) (string, bool)
- func GetOSMimeType(googleWorkspaceMimeType string) (string, string)
- func GetTransferCall(newOwner, fileId string, service *drive.Service) *drive.PermissionsCreateCall
- type API
- func Build(client *http.Client, subject string, ctx context.Context) (*API, error)
- func BuildImpersonator(subject string, scopes []string, serviceAccountKey []byte, ctx context.Context) (*API, error)
- func BuildOAuth2(subject string, scopes []string, clientSecret, authorizationToken []byte, ...) (*API, error)
- func (receiver *API) ChangeFileOwner(newOwner, fileId string, doIt bool) error
- func (receiver *API) ChangeFileOwnerWorker(newOwner, fileId string, doIt bool, wg *sync.WaitGroup)
- func (receiver *API) CopyFile(fileId, parentFolderId, fileName string) (*drive.File, error)
- func (receiver *API) CopyFileWorker(fileInformation []string, wg *sync.WaitGroup)
- func (receiver *API) CopyFolder(sourceFolderId, newSourceFolderName, parentFolderId string) error
- func (receiver *API) CreateFolder(folderName, parentFolderId string, permissions []*drive.Permission) (*drive.File, error)
- func (receiver *API) DownloadFile(file *drive.File) (*DownloadedFile, error)
- func (receiver *API) DownloadFileById(fileId string) (*DownloadedFile, error)
- func (receiver *API) GetAbout() *drive.About
- func (receiver *API) GetFileById(fileID string) (*drive.File, error)
- func (receiver *API) GetFilePermissions(file *drive.File) string
- func (receiver *API) GetNestedFiles(targetFolderId string) ([]*drive.File, error)
- func (receiver *API) MoveFile(fileId, parentFolderId string) (*drive.File, error)
- func (receiver *API) PermissionShareHandler(calls []*drive.PermissionsCreateCall, doIt bool)
- func (receiver *API) QueryFiles(q string) ([]*drive.File, error)
- func (receiver *API) RemovePermissionByID(fileID, permissionID string, execute bool) error
- func (receiver *API) RemovePermissionByIDWorker(fileID, permissionId string, wg *sync.WaitGroup, execute bool) error
- func (receiver *API) RemoveUserPermission(fileId string, permission *drive.Permission, execute bool) error
- func (receiver *API) RemoveUserPermissionWorker(fileID string, permission *drive.Permission, wg *sync.WaitGroup, execute bool) error
- func (receiver *API) ShareFile(fileId, email, accountType, role string, notify, doIt bool) (*drive.Permission, error)
- func (receiver *API) UploadFile(filename, parentFolderId string, data []byte) (*drive.File, error)
- type DownloadedFile
- type FileTransfer
Constants ¶
This section is empty.
Variables ¶
View Source
var DriveScope = []string{drive.DriveScope}
View Source
var DriveScopeReadOnly = []string{drive.DriveReadonlyScope}
Functions ¶
func GetFileIdFromUrl ¶
func GetOSMimeType ¶
func GetTransferCall ¶
func GetTransferCall(newOwner, fileId string, service *drive.Service) *drive.PermissionsCreateCall
Types ¶
type API ¶
func BuildImpersonator ¶
func BuildOAuth2 ¶
func (*API) ChangeFileOwner ¶
func (*API) ChangeFileOwnerWorker ¶
func (*API) CopyFileWorker ¶
func (*API) CopyFolder ¶
func (*API) CreateFolder ¶
func (*API) DownloadFile ¶
func (receiver *API) DownloadFile(file *drive.File) (*DownloadedFile, error)
func (*API) DownloadFileById ¶
func (receiver *API) DownloadFileById(fileId string) (*DownloadedFile, error)
func (*API) GetFileById ¶
func (*API) GetFilePermissions ¶
func (*API) GetNestedFiles ¶
func (*API) PermissionShareHandler ¶
func (*API) QueryFiles ¶
func (*API) RemovePermissionByID ¶
func (*API) RemovePermissionByIDWorker ¶
func (*API) RemoveUserPermission ¶
func (*API) RemoveUserPermissionWorker ¶
type DownloadedFile ¶
type DownloadedFile struct { FileInfo *drive.File `json:"file_info"` Blob []byte `json:"blob"` }
type FileTransfer ¶
Click to show internal directories.
Click to hide internal directories.