store

package
v0.0.0-...-b09e5ed Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIDRecursive

func GetIDRecursive(client idGetter, path string) (string, error)

GetIDRecursive navigates up the directory tree

Types

type File

type File struct {
	IsFolder bool
	Name     string
}

File represents a filesystem entry

type FilesCreateCall

type FilesCreateCall interface {
	Do(opts ...googleapi.CallOption) (*drive.File, error)
	Fields(s ...googleapi.Field) FilesCreateCall
	Media(r io.Reader, options ...googleapi.MediaOption) FilesCreateCall
}

type FilesGetCall

type FilesGetCall interface {
	Download(opts ...googleapi.CallOption) (*http.Response, error)
}

type FilesListCall

type FilesListCall interface {
	Spaces(spaces string) FilesListCall
	PageSize(pageSize int64) FilesListCall
	Q(q string) FilesListCall
	Fields(s ...googleapi.Field) FilesListCall
	Do(opts ...googleapi.CallOption) (*drive.FileList, error)
}

type FilesService

type FilesService interface {
	//Copy(string, *drive.File) *drive.FilesCopyCall
	Create(*drive.File) FilesCreateCall
	//Delete(string) *drive.FilesDeleteCall
	//EmptyTrash() *drive.FilesEmptyTrashCall
	//Export(string, string) *drive.FilesExportCall
	//GenerateIds() *drive.FilesGenerateIdsCall
	Get(string) FilesGetCall
	List() FilesListCall
}

type ReadOnlyStore

type ReadOnlyStore interface {
	Read(path string, contents io.Writer) error
	List(path string) ([]File, error)
}

type Service

type Service struct {
	Files FilesService
}

type SimpleFileStore

type SimpleFileStore interface {
	Create(path string, contents io.Reader) error
	Read(path string, contents io.Writer) error
	Update(path string, contents io.Reader) error
	Delete(path string) error
	List(path string) ([]File, error)
	TestPath(path string) (bool, error)
}

SimpleFileStore is a simplied interface over a file store

func NewClient

func NewClient() SimpleFileStore

NewClient runs the outh flow if necessary and builds an authenticated Google Drive client

Directories

Path Synopsis
This is practically copied verbatim from:
This is practically copied verbatim from:

Jump to

Keyboard shortcuts

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