Documentation
¶
Overview ¶
Package sync handles building and executing file sync plans.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decision ¶
type Decision int
Decision represents a user-selectable sync action for a single file.
func AutoDecision ¶
AutoDecision returns the most sensible default decision for a diff session.
A 2-second threshold tolerates FAT32 time resolution and minor clock drift.
type ItemProgress ¶
type ItemProgress struct {
Item SyncItem
Status ItemStatus
BytesDone int64
BytesTotal int64
Err error
}
ItemProgress holds the current transfer state for one SyncItem.
type ItemStatus ¶
type ItemStatus int
ItemStatus tracks the state of a single SyncItem during execution.
const ( ItemPending ItemStatus = iota ItemInFlight ItemDone ItemFailed )
type Progress ¶
type Progress struct {
Items []ItemProgress
TotalBytes int64
SentBytes int64
}
Progress holds the overall sync execution state.
type SyncDirection ¶
type SyncDirection int
SyncDirection specifies whether to push local→remote or pull remote→local.
const ( DirectionUpload SyncDirection = iota // local → remote DirectionDownload // remote → local )
type SyncItem ¶
type SyncItem struct {
LocalPath string
RemotePath string
Direction SyncDirection
}
SyncItem is a single file to transfer.
Click to show internal directories.
Click to hide internal directories.