Documentation
¶
Index ¶
- type DB
- func (m *DB) Close() error
- func (m *DB) CountSyncedTo(destination string, count *int) error
- func (m *DB) GetAnySyncedFiles(deviceSerial string) ([]Entry, error)
- func (m *DB) GetDeviceStats(deviceSerial string, numDestinations int) (DeviceStats, error)
- func (m *DB) GetFullySyncedFiles(deviceSerial string, destinations []string) ([]Entry, error)
- func (m *DB) GetLocalSyncedFiles(destinations []string, anyDest bool) ([]Entry, error)
- func (m *DB) GetUnpushedFiles(destination string) ([]Entry, error)
- func (m *DB) IsFullySynced(deviceSerial, remotePath string, destinations []string) (bool, error)
- func (m *DB) IsPulled(deviceSerial, remotePath string, size, mtime int64) (bool, error)
- func (m *DB) Path() string
- func (m *DB) QueryByLocalPath(localPath string) ([]Entry, error)
- func (m *DB) RecordDestSync(fileID int64, destination string) error
- func (m *DB) RecordPull(deviceSerial, remotePath, localPath string, size, mtime int64) (int64, error)
- type DestSync
- type DeviceStats
- type Entry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps the SQLite manifest database.
func (*DB) CountSyncedTo ¶ added in v0.5.0
CountSyncedTo counts the number of files synced to a given destination.
func (*DB) GetAnySyncedFiles ¶ added in v0.2.0
GetAnySyncedFiles returns files synced to at least one destination for a device.
func (*DB) GetDeviceStats ¶
func (m *DB) GetDeviceStats(deviceSerial string, numDestinations int) (DeviceStats, error)
GetDeviceStats returns sync statistics for a device.
func (*DB) GetFullySyncedFiles ¶
GetFullySyncedFiles returns files synced to ALL destinations for a device (safe to clean).
func (*DB) GetLocalSyncedFiles ¶ added in v0.2.0
GetLocalSyncedFiles returns files with a local_path that have been synced to destinations. If anyDest is true, files synced to at least one destination are returned. If anyDest is false, only files synced to all given destinations are returned.
func (*DB) GetUnpushedFiles ¶
GetUnpushedFiles returns files that have been pulled but not synced to the given destination.
func (*DB) IsFullySynced ¶
IsFullySynced checks if a file has been synced to all given destinations.
func (*DB) IsPulled ¶
IsPulled returns true if the file has been pulled (device_serial, remote_path, size, mtime match).
func (*DB) QueryByLocalPath ¶ added in v0.5.0
QueryByLocalPath returns all file entries with the given local_path.
func (*DB) RecordDestSync ¶
RecordDestSync marks a file as synced to a destination.
type DeviceStats ¶
type DeviceStats struct {
TotalFiles int
PulledFiles int
SyncedFiles int // fully synced to all destinations
}
DeviceStats returns sync statistics for a device.