sync

package
v0.0.0-...-a80f706 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSyncer

func NewSyncer(fs io.Filesystem) *syncer

func Sync

func Sync(config SyncConfig) error

Types

type FileMismatchIssue

type FileMismatchIssue string
const (
	MissingFromTarget FileMismatchIssue = "missing from target"
	MissingFromSource FileMismatchIssue = "missing from source"
	FileCollision     FileMismatchIssue = "file collision"
)

type Mismatch

type Mismatch struct {
	From  string
	To    string
	Issue FileMismatchIssue
}

type SyncConfig

type SyncConfig struct {
	Source  string
	Target  string
	DryRun  bool
	Ignores []string
	// contains filtered or unexported fields
}

type Syncer

type Syncer interface {
	GatherDirs(ctx context.Context, target string) ([]string, error)
	GatherMissingSymlinks(ctx context.Context, ignoredDirs []string, source, target string) ([]Mismatch, error)
	CreateSymlink(from, to, backup string) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL