Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltDao ¶
type BoltDao struct {
// contains filtered or unexported fields
}
BoltDao provides caching of file information using a bbold database.
func OpenDb ¶
func OpenDb(fileName string, getFiles func() (chan FileOrError, error)) (*BoltDao, error)
OpenDb opens the specified data file. If the database is empty then getFiles is used to populate it.
func (*BoltDao) AddOrUpdate ¶
func (dao *BoltDao) AddOrUpdate(remoteID string, name string, mimeType string, size uint64, md5checksum *string, parentIDs []string, lastModified string, localID *string) error
AddOrUpdate adds or updates the records for a file.
func (*BoltDao) FindByID ¶
func (dao *BoltDao) FindByID(finfo FileInfo) (rf *RemoteFile)
FindByID looks up a file record using the local ID.
func (*BoltDao) FindByPath ¶
func (dao *BoltDao) FindByPath(remotePath string) *RemoteFile
FindByPath looks up a file record using the remote path.
type FileOrError ¶
type FileOrError struct {
File *RemoteFile
Error error
}
FileOrError contains either a cache entry or an error.
type RemoteFile ¶
type RemoteFile struct {
Name string
MimeType string
Size uint64
Md5Checksum *string
ParentIDs []string // remote IDs of the file's parents
LastModified *string
LocalID *string
RemoteID *string
}
Cache record for a remote file.
func NewRemoteFile ¶
func (*RemoteFile) ModTime ¶
func (rf *RemoteFile) ModTime() time.Time
Click to show internal directories.
Click to hide internal directories.