stsync

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 8 Imported by: 0

README

Selective Tree Sync

And Promotable.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotDir = errors.New("not a directory")
)
View Source
var (
	ErrRootIsNotDir = errors.New("root is not a directory")
)

Functions

func NewErrNotDir

func NewErrNotDir(path string) error

func Sync

func Sync(dst, src string) error

Types

type Root

type Root struct {
	Path      string
	Patterns  []string
	FileTypes []fs.FileMode
}

func (*Root) FindFiles

func (r *Root) FindFiles() ([]string, error)

func (*Root) FindFilesContext

func (r *Root) FindFilesContext(ctx context.Context) ([]string, error)

func (*Root) FindFilesFSContext

func (r *Root) FindFilesFSContext(ctx context.Context, fsys fs.FS) ([]string, error)

FindFilesFSContext returns the directories that match the values in Patterns.

The paths contain the name of the root directory and below.

type Roots

type Roots struct {
	Destination string
	Source      string
	Patterns    []string
	FileTypes   []fs.FileMode
	// contains filtered or unexported fields
}

func (*Roots) Dst

func (r *Roots) Dst() []string

func (*Roots) FindFiles

func (r *Roots) FindFiles() error

func (*Roots) FindFilesContext

func (r *Roots) FindFilesContext(ctx context.Context) error

func (*Roots) Src

func (r *Roots) Src() []string

type Syncer

type Syncer struct {
	Src string
	Dst string
}

func (*Syncer) Sync

func (s *Syncer) Sync() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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