gdrive

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorBadRequest         = 400
	ErrorInvalidCredentials = 401
	ErrorLimitExceeded      = 403
	ErrorFileNotFound       = 404
	ErrorTooManyRequests    = 429
	ErrorBackendError       = 500
	ErrorUnknownError       = 501
)
View Source
const (
	False = "false"
	True  = "true"
	Jpeg  = "image/jpeg"
	Gif   = "image/gif"
	Png   = "image/png"

	Folder  = "application/vnd.google-apps.folder"
	Sheet   = "application/vnd.google-apps.spreadsheet"
	Doc     = "application/vnd.google-apps.document"
	Present = "application/vnd.google-apps.presentation"
)

Common mime types

View Source
const (
	InitState = iota
	TermState
	OpState
	NotState
)

Variables

This section is empty.

Functions

func FullScope

func FullScope() string

Drive API Scopes

func ParseTime

func ParseTime(tstr string) (time.Time, error)

func ReadOnlyScope

func ReadOnlyScope() string

Types

type DriveService

type DriveService struct {
	Root *drive.File
	// contains filtered or unexported fields
}

func NewDriveService

func NewDriveService(token *oauth2.Token, config *oauth2.Config) (*DriveService, error)

func (*DriveService) About

func (ds *DriveService) About(fields ...googleapi.Field) (*drive.About, error)

func (*DriveService) Download

func (ds *DriveService) Download(id string, path string) (int64, error)

func (*DriveService) Get

func (ds *DriveService) Get(id string) (*drive.File, error)

func (*DriveService) GetByName

func (ds *DriveService) GetByName(name string, folder bool, trashed bool, fileFields string) (*drive.File, error)

func (*DriveService) GetByQuery

func (ds *DriveService) GetByQuery(q *Query, fileFields string) (*drive.File, error)

func (*DriveService) List

func (ds *DriveService) List(pageSize int64, parentId string, fileFields string) (*drive.FileList, error)

func (*DriveService) ListAll

func (ds *DriveService) ListAll(parentId string, fileFields string) ([]*drive.File, error)

func (*DriveService) SearchAll

func (ds *DriveService) SearchAll(q *Query, fileFields string) ([]*drive.File, error)

func (*DriveService) SearchFolder

func (ds *DriveService) SearchFolder(parentId string, query *Query, fileFields string) ([]*drive.File, error)

type Query

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

func NewQuery

func NewQuery() *Query

func (*Query) And

func (q *Query) And() *Query

func (*Query) Contains

func (q *Query) Contains(value string) *Query

func (*Query) Eq

func (q *Query) Eq(value string) *Query

func (*Query) Err

func (q *Query) Err() *googleapi.Error

func (*Query) In

func (q *Query) In(value string) *Query

func (*Query) IsEmpty

func (q *Query) IsEmpty() bool

func (*Query) MimeType

func (q *Query) MimeType() *Query

func (*Query) Name

func (q *Query) Name() *Query

func (*Query) Not

func (q *Query) Not() *Query

func (*Query) NotEq

func (q *Query) NotEq(value string) *Query

func (*Query) Or

func (q *Query) Or() *Query

func (*Query) Parents

func (q *Query) Parents() *Query

func (*Query) Reset

func (q *Query) Reset()

func (*Query) String

func (q *Query) String() string

func (*Query) TrashedEq

func (q *Query) TrashedEq(b bool) *Query

Jump to

Keyboard shortcuts

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