Documentation ¶
Index ¶
- Constants
- func CreateFolder(r *http.Request, file *drive.File) (string, error)
- func Get(key string) ([]byte, error)
- func GetGDiveFolderIDs(r *http.Request, q string) (*map[string]string, error)
- func GetGDriveFile(r *http.Request, name string, field googleapi.Field) (*drive.File, error)
- func GetGDriveFileByID(r *http.Request, id string, field googleapi.Field) (*drive.File, error)
- func GetGDriveFileContent(r *http.Request, name string, field googleapi.Field) (*drive.File, []byte, error)
- func GetGDriveService(r *http.Request) (*drive.Service, error)
- func GetTokenBucketGDriveAPI() chan struct{}
- func IsDeadlineExceededError(err error) bool
- func IsFileNotExportableError(err error) bool
- func IsInvalidSecurityTicket(err error) bool
- func IsRateLimit(err error) bool
- func IsServerError(err error) bool
- func NewDriveFileDoesNotExistError() error
- func SetConfig(cid string, cs string, rt string)
- func SetRootFolder(name string, permission *drive.Permission) error
- func StoreGDrive(r *http.Request, filename string, file *drive.File, payload *[]byte) (*drive.File, error)
- func StoreGDriveByID(r *http.Request, id string, file *drive.File, payload *[]byte) (*drive.File, error)
- func Triable(retries int, err error) (bool, int, error)
- type DriveFileDoesNotExistError
Constants ¶
const ( // MimeGSuiteDoc is mime-types of the document on Google Drive. MimeGSuiteDoc string = "application/vnd.google-apps.document" // MimeGSuiteFolder is mime-types of the folder on Google Drive. MimeGSuiteFolder string = "application/vnd.google-apps.folder" )
const ( // MinimumFilesField is minimim search fields on Google Drive API. MinimumFilesField googleapi.Field = "files/id" )
Variables ¶
This section is empty.
Functions ¶
func CreateFolder ¶
CreateFolder returns a ID of new Google Drive Folder.
func GetGDiveFolderIDs ¶
GetGDiveFolderIDs returns a map of folder IDs on Google Drive.
func GetGDriveFile ¶
GetGDriveFile returns a file that is a given file name on Google Drive.
func GetGDriveFileByID ¶
func GetGDriveFileByID( r *http.Request, id string, field googleapi.Field, ) ( *drive.File, error, )
GetGDriveFileByID returns a file that is a given `file.Id` on Google Drive.
func GetGDriveFileContent ¶
func GetGDriveFileContent( r *http.Request, name string, field googleapi.Field, ) ( *drive.File, []byte, error, )
GetGDriveFileContent returns a file with content on Google Drive.
func GetGDriveService ¶
GetGDriveService returns the API service of Google Drive.
func GetTokenBucketGDriveAPI ¶
func GetTokenBucketGDriveAPI() chan struct{}
GetTokenBucketGDriveAPI returns a token-bucket for calling the Google Drive API.
func IsDeadlineExceededError ¶
IsDeadlineExceededError returns is whether it is "Deadline exceeded" error or not.
func IsFileNotExportableError ¶
IsFileNotExportableError returns is whether it is "fileNotExportable" error or not.
func IsInvalidSecurityTicket ¶
IsInvalidSecurityTicket returns is whether it is "invalid security ticket" error or not.
func IsRateLimit ¶
IsRateLimit returns is whether it is "userRateLimitExceeded" or "rateLimitExceeded" server errors or not.
func IsServerError ¶
IsServerError returns is whether it is 50X server errors or not.
func NewDriveFileDoesNotExistError ¶
func NewDriveFileDoesNotExistError() error
NewDriveFileDoesNotExistError returns a DriveFileDoesNotExistError.
func SetRootFolder ¶
SetRootFolder sets name and permission to a top folder on Google Drive.
func StoreGDrive ¶
func StoreGDrive( r *http.Request, filename string, file *drive.File, payload *[]byte, ) ( *drive.File, error, )
StoreGDrive stores a file that is a given filename on Google Drive.
Types ¶
type DriveFileDoesNotExistError ¶
type DriveFileDoesNotExistError struct {
// contains filtered or unexported fields
}
DriveFileDoesNotExistError is as HTTP response that is 40X HTTP status.
func (DriveFileDoesNotExistError) Error ¶
func (err DriveFileDoesNotExistError) Error() string