Documentation ¶
Index ¶
- Constants
- type CachedDriveFile
- type KeyValueEntry
- type MetaService
- func (m *MetaService) GetChildren(localparentid int64) (files []*CachedDriveFile, err error)
- func (m *MetaService) GetChildrenWithName(localparentid int64, name string) (file *CachedDriveFile, err error)
- func (m *MetaService) GetLargestChangeId() (largestId int64, err error)
- func (m *MetaService) ListDownloads(limit int64, min int64, max int64) (files []*CachedDriveFile, err error)
- func (m *MetaService) LocalCreate(localParentId int64, name string, filesize int64, isDir bool) (*CachedDriveFile, error)
- func (m *MetaService) LocalMod(localParentId int64, name string, newParentId int64, newName string, ...) (err error)
- func (m *MetaService) LocalRm(localParentId int64, name string, isDir bool) (err error)
- func (m *MetaService) RemoteMod(remoteId string, newParentRemoteId string, data *CachedDriveFile) (err error)
- func (m *MetaService) RemoteRm(remoteId string) (err error)
- func (m *MetaService) SaveLargestChangeId(id int64) error
- func (m *MetaService) SetOp(localId int64, op int) (err error)
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 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) 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.
Click to show internal directories.
Click to hide internal directories.