Documentation ¶
Overview ¶
DriveService translates blobserver.Storage methods into Google Drive API methods.
Index ¶
- Constants
- type DriveService
- func (s *DriveService) Fetch(id string) (body io.ReadCloser, size int64, err error)
- func (s *DriveService) Get(id string) (*client.File, error)
- func (s *DriveService) List(pageToken string, limit int) (files []*client.File, next string, err error)
- func (s *DriveService) Stat(id string) (int64, error)
- func (s *DriveService) Trash(id string) (err error)
- func (s *DriveService) Upsert(id string, data io.Reader) (file *client.File, err error)
Constants ¶
View Source
const ( MimeTypeDriveFolder = "application/vnd.google-apps.folder" MimeTypeCamliBlob = "application/vnd.camlistore.blob" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DriveService ¶
type DriveService struct {
// contains filtered or unexported fields
}
DriveService wraps Google Drive API to implement utility methods to be performed on the root Drive destination folder.
func New ¶
func New(transport *oauth.Transport, parentId string) (*DriveService, error)
New initiates a new DriveService.
func (*DriveService) Fetch ¶
func (s *DriveService) Fetch(id string) (body io.ReadCloser, size int64, err error)
Fetch retrieves the metadata and contents of a file.
func (*DriveService) Get ¶
func (s *DriveService) Get(id string) (*client.File, error)
Get retrieves a file with its title
func (*DriveService) List ¶
func (s *DriveService) List(pageToken string, limit int) (files []*client.File, next string, err error)
Lists the folder identified by parentId.
func (*DriveService) Stat ¶
func (s *DriveService) Stat(id string) (int64, error)
Stat retrieves file metadata and returns file size. Returns error if file is not found.
func (*DriveService) Trash ¶
func (s *DriveService) Trash(id string) (err error)
Trash trashes an existing file.
Click to show internal directories.
Click to hide internal directories.