Documentation ¶
Index ¶
- type CheckPoint
- type DownloadSpec
- type DownloadURL
- type DriveDB
- func (d *DriveDB) AllFileIds() ([]string, error)
- func (d *DriveDB) ChildFileIds(fileId string) ([]string, error)
- func (d *DriveDB) Close()
- func (d *DriveDB) FileByFileId(fileId string) (*File, error)
- func (d *DriveDB) FileById(fileId string) (*gdrive.File, error)
- func (d *DriveDB) FileByInode(inode uint64) (*File, error)
- func (d *DriveDB) FileIdForInode(inode uint64) (string, error)
- func (d *DriveDB) FlushCachedInode(inode uint64)
- func (d *DriveDB) FlushCachedInodeForFileId(fileId string)
- func (d *DriveDB) InodeForFileId(fileId string) (uint64, error)
- func (d *DriveDB) ReadFiledata(fileId string, offset, size, filesize int64) ([]byte, error)
- func (d *DriveDB) Refresh(fileId string) (*File, error)
- func (d *DriveDB) RemoveAllFiles() error
- func (d *DriveDB) RemoveFile(f *gdrive.File) error
- func (d *DriveDB) RemoveFileById(fileId string, batch *leveldb.Batch) error
- func (d *DriveDB) Service() *gdrive.Service
- func (d *DriveDB) UpdateFile(batch *leveldb.Batch, f *gdrive.File) (*File, error)
- func (d *DriveDB) WaitUntilSynced()
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckPoint ¶
func NewCheckpoint ¶
func NewCheckpoint() CheckPoint
type DownloadSpec ¶
type DownloadSpec struct {
// contains filtered or unexported fields
}
type DownloadURL ¶
type DriveDB ¶
func NewDriveDB ¶
func NewDriveDB(client *http.Client, dbPath, cachePath string, pollInterval time.Duration, rootId string) (*DriveDB, error)
NewDriveDB creates a new DriveDB and starts syncing metadata.
func (*DriveDB) AllFileIds ¶
AllFileIds returns the IDs of all Google Drive file objects currently stored.
func (*DriveDB) ChildFileIds ¶
ChildFileIds returns the IDs of all Files that have parent refs to the given file.
func (*DriveDB) Close ¶
func (d *DriveDB) Close()
Close closes DriveDB, waiting until all iterators are closed.
func (*DriveDB) FileByFileId ¶
FileByFileId returns a *File given a fileId
func (*DriveDB) FileByInode ¶
FileByInode returns a *File given an inode number
func (*DriveDB) FileIdForInode ¶
FileIdForInode returns the FileId associated with a given inode.
func (*DriveDB) FlushCachedInode ¶
func (*DriveDB) FlushCachedInodeForFileId ¶
func (*DriveDB) InodeForFileId ¶
InodeForFileId returns a File's inode number, given its ID. Allocates a new inode number if needed, and commits immediately to leveldb.
func (*DriveDB) ReadFiledata ¶
ReadFiledata reads a chunk of a file, possibly from cache.
func (*DriveDB) RemoveAllFiles ¶
RemoveAllFiles removes all file entries and child references from leveldb. This also flushes the cache, but preserves the fileid->inode mapping
func (*DriveDB) RemoveFileById ¶
func (*DriveDB) UpdateFile ¶
UpdateFile commits a gdrive.File to levelDB, updating all mappings and allocating inodes if needed.
func (*DriveDB) WaitUntilSynced ¶
func (d *DriveDB) WaitUntilSynced()
WaitUntilSynced blocks until are are synced with Drive.