metadata

package
v0.0.0-...-5513633 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpNone = iota
	OpDownload
	OpUpload
	OpDelete

	MimeTypeFolder = "application/vnd.google-apps.folder"
	IdRoot         = "root"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedDriveFile

type CachedDriveFile struct {
	LocalId       int64
	LocalParentId int64
	Id            string
	Name          string
	LastMod       time.Time
	Md5Checksum   string
	LastEtag      string
	FileSize      int64
	IsDir         bool

	Op int
}

CachedDriveFile represents metadata about a Drive file or folder. TODO(burcud): Rename it to FileEntry

type KeyValueEntry

type KeyValueEntry struct {
	Key   string
	Value string
}

type MetaService

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

MetaService implements utility methods to retrieve, save, delete metadata about Google Drive files/folders.

func New

func New(dbPath string) (metaservice *MetaService, err error)

Initiates a new MetaService.

func (*MetaService) GetChildren

func (m *MetaService) GetChildren(localparentid int64) (files []*CachedDriveFile, err error)

Gets the children of folder identified by parentId.

func (*MetaService) GetChildrenWithName

func (m *MetaService) GetChildrenWithName(localparentid int64, name string) (file *CachedDriveFile, err error)

Looks up for files under parentId, named with name.

func (*MetaService) GetLargestChangeId

func (m *MetaService) GetLargestChangeId() (largestId int64, err error)

Gets the largest change id synchnonized.

func (*MetaService) ListDownloads

func (m *MetaService) ListDownloads(limit int64, min int64, max int64) (files []*CachedDriveFile, err error)

func (*MetaService) LocalCreate

func (m *MetaService) LocalCreate(localParentId int64, name string, filesize int64, isDir bool) (*CachedDriveFile, error)

func (*MetaService) LocalMod

func (m *MetaService) LocalMod(localParentId int64, name string, newParentId int64, newName string, newFileSize int64) (err error)

func (*MetaService) LocalRm

func (m *MetaService) LocalRm(localParentId int64, name string, isDir bool) (err error)

func (*MetaService) RemoteMod

func (m *MetaService) RemoteMod(remoteId string, newParentRemoteId string, data *CachedDriveFile) (err error)

Permanently saves a file/folder's metadata.

func (*MetaService) RemoteRm

func (m *MetaService) RemoteRm(remoteId string) (err error)

func (*MetaService) SaveLargestChangeId

func (m *MetaService) SaveLargestChangeId(id int64) error

Persists the largest change id synchnonized.

func (*MetaService) SetOp

func (m *MetaService) SetOp(localId int64, op int) (err error)

Enqueues a file into the upload or download queue.

Jump to

Keyboard shortcuts

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