Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitPatterns ¶
SplitPatterns parses a comma/newline separated pattern list.
Types ¶
type Action ¶
type Action struct {
Type ActionType
RelativePath string
SourcePath string
DestinationPath string
Size int64
SourceModified time.Time
}
Action is one immutable plan item.
type ActionType ¶
type ActionType string
ActionType describes a single sync action in a generated plan.
const ( ActionCopy ActionType = "copy" ActionUpdate ActionType = "update" ActionDelete ActionType = "delete" ActionSkip ActionType = "skip" )
type CompareMode ¶
type CompareMode string
CompareMode controls how source and destination files are compared.
const ( CompareMTimeSize CompareMode = "mtime_size" CompareSizeOnly CompareMode = "size_only" CompareExactTimestamp CompareMode = "exact_timestamps" CompareChecksum CompareMode = "checksum" )
type ExecuteOptions ¶
type ExecuteOptions struct {
Concurrency int
CompletedPaths map[string]struct{} // paths to skip (already completed from prior run)
MaxRetries int
RetryBackoff time.Duration
BandwidthLimit int64 // bytes per second, 0 = unlimited
}
ExecuteOptions customizes execution behavior.
type IndexedFile ¶
type IndexedFile struct {
RelativePath string
FullPath string
Size int64
Modified time.Time
Checksum string // optional: content hash if available
}
IndexedFile is a normalized file entry keyed by relative path.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher evaluates include/exclude rules with "last match wins" semantics.
func NewMatcher ¶
NewMatcher builds an ordered matcher from options.
type Options ¶
type Options struct {
Direction SyncDirection
CompareMode CompareMode
Delete bool
DryRun bool
NoOverwrite bool
IncludeRules []string
ExcludeRules []string
Concurrency int
CaseInsensitiveDestination bool
ExactTimestampsAllowed bool
MaxRetries int // max retry attempts per action (0 = no retry)
RetryBackoff time.Duration // initial backoff duration (doubles each retry)
BandwidthLimit int64 // bytes per second, 0 = unlimited
}
Options configures planner and executor behavior.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns safe defaults for sync planning and execution.
type Plan ¶
type Plan struct {
SourceRoot string
DestinationRoot string
Options Options
Actions []Action
Counts Counts
BytesToTransfer int64
Warnings []string
}
Plan is the immutable output of planner generation.
func BuildPlan ¶
func BuildPlan(ctx context.Context, src backend.Backend, sourceRoot string, dst backend.Backend, destinationRoot string, opts Options, onProgress func(PlanningProgress)) (Plan, error)
BuildPlan scans source/destination and produces an immutable sync plan.
func (Plan) RunnableActions ¶
RunnableActions returns only mutating actions.
type PlanningProgress ¶
PlanningProgress is emitted during scan/planning phases.
type Progress ¶
type Progress struct {
Completed int
Total int
Action Action
Err error
BytesDone int64 // bytes transferred so far for the current action
BytesTotal int64 // total bytes for the current action (= Action.Size)
}
Progress is emitted by the executor as actions complete or as bytes transfer. When BytesDone > 0 and Err == nil, this is a byte-level progress update for the current action. Completed reflects the number of already-finished actions (not counting the in-progress one), so the UI can compute overall progress as (Completed + BytesDone/BytesTotal) / Total.
type Summary ¶
type Summary struct {
DryRun bool
Planned Counts
Applied Counts
Completed int
Total int
Failures []Failure
StartedAt time.Time
EndedAt time.Time
CompletedPaths map[string]struct{} // successfully completed relative paths (for resume)
}
Summary captures a sync execution result.
func ExecutePlan ¶
func ExecutePlan(ctx context.Context, src backend.Backend, dst backend.Backend, plan Plan, opts ExecuteOptions, onProgress func(Progress)) (Summary, error)
ExecutePlan runs a prebuilt sync plan and returns an execution summary.
type SyncDirection ¶
type SyncDirection string
SyncDirection describes panel-to-panel sync direction.
const ( DirectionLeftToRight SyncDirection = "left_to_right" DirectionRightToLeft SyncDirection = "right_to_left" )