dsync

package
v0.2.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(sfs fs.FS, sdir string, tfs vfs.ReadWritable, tdir string, options ...Option) error

Dir syncs the source directory from the source filesystem to the target directory in the target filesystem

func Rel

func Rel(sdir, tdir string) func(path string) (string, error)

func To added in v0.2.4

func To(sfs fs.FS, tfs vfs.ReadWritable, to string, options ...Option) error

To syncs the "to" directory from the source to target filesystem

Types

type Op

type Op struct {
	Type OpType
	Path string
	Data []byte
}

func (Op) String

func (o Op) String() string

type OpType

type OpType uint8
const (
	CreateType OpType = iota + 1
	UpdateType
	DeleteType
)

func (OpType) String

func (ot OpType) String() string

type Option

type Option func(o *option)

func WithLog added in v0.2.6

func WithLog(log log.Log) Option

func WithSkip

func WithSkip(skips ...skipFunc) Option

Provide a skip function

Note: try to skip as high up in the tree as possible. E.g. if the source filesystem doesn't have bud, it will delete bud, even if you're skipping bud/generate.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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