gdrive

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is an abstraction object for the Google Drive service. It is intended to satisfy `stationery.Service` interface.

func GetService

func GetService(credentialsFile string) (*Service, error)

GetService creates a new `drive.Service` from a credentials file. The argument is just the path to a credentials file, which are expected to identify a service account. If the argument is empty, and on any other error, an error is returned.

func (*Service) ExportFile

func (s *Service) ExportFile(file *drive.File, MIMEType string) (content string, err error)

ExportFile exports the file in the first argument, returning the content in the specified MIME type, as the second argument.

func (*Service) GetFiles

func (s *Service) GetFiles(q string) (files []*drive.File, err error)

GetFiles receives a query parameter and returns a list of `drive.File`s or an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL