Documentation
¶
Index ¶
- func ApplyPlan(ctx context.Context, srcFS FileSystem, dstFS FileSystem, plan *Plan, ...) error
- func BuildBidirectionalPlans(leftFS FileSystem, rightFS FileSystem, leftRoot string, rightRoot string) (*Plan, *Plan, error)
- func RunDaemonLoop(ctx context.Context, interval time.Duration, fn func(context.Context) error) error
- type ApplyOptions
- type CommandArgs
- type DeleteScope
- type DesiredEntry
- type FileSystem
- type PathSpec
- type Plan
- type Sync
- type SyncConnect
- type SyncInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPlan ¶
func ApplyPlan(ctx context.Context, srcFS FileSystem, dstFS FileSystem, plan *Plan, options ApplyOptions) error
func BuildBidirectionalPlans ¶ added in v0.9.0
func BuildBidirectionalPlans(leftFS FileSystem, rightFS FileSystem, leftRoot string, rightRoot string) (*Plan, *Plan, error)
Types ¶
type ApplyOptions ¶
type CommandArgs ¶
type CommandArgs struct {
Delete bool
DryRun bool
Permission bool
Daemon bool
DaemonInterval time.Duration
Bidirectional bool
ParallelNum int
Sources []string
Destination string
}
func ParseCommandArgs ¶
func ParseCommandArgs(args []string) (CommandArgs, error)
type DeleteScope ¶
type DesiredEntry ¶
type FileSystem ¶
type FileSystem interface {
Expand(raw string) ([]string, error)
Resolve(raw string) (string, error)
Stat(path string) (fs.FileInfo, error)
Walk(root string, fn func(path string, info fs.FileInfo) error) error
Open(path string) (io.ReadCloser, error)
OpenWriter(path string, perm fs.FileMode) (io.WriteCloser, error)
MkdirAll(path string) error
Remove(path string) error
RemoveDir(path string) error
Chmod(path string, mode fs.FileMode) error
Chtimes(path string, atime, mtime time.Time) error
Clean(path string) string
Join(elem ...string) string
Dir(path string) string
Separator() string
}
func NewLocalFS ¶
func NewLocalFS() (FileSystem, error)
func NewRemoteFS ¶
func NewRemoteFS(client *sftp.Client, pwd string) FileSystem
type PathSpec ¶
func ParsePathSpec ¶
type Plan ¶
type Plan struct {
Desired map[string]DesiredEntry
DeleteScopes []DeleteScope
}
func BuildPlan ¶
func BuildPlan(srcFS FileSystem, dstFS FileSystem, sourceArgs []string, destination string) (*Plan, error)
type Sync ¶
type Sync struct {
Run *sshl.Run
// ControlMasterOverride temporarily overrides the config value for this
// command execution.
ControlMasterOverride *bool
DryRun bool
From SyncInfo
To SyncInfo
Config conf.Config
Permission bool
Delete bool
Daemon bool
Bidirectional bool
DaemonInterval time.Duration
ParallelNum int
Progress *mpb.Progress
ProgressWG *syncpkg.WaitGroup
}
type SyncConnect ¶
Click to show internal directories.
Click to hide internal directories.