Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Difference ¶
type Difference struct { Src string Dst string // All the entries in the src and dst Lhs *fio.FioMap Rhs *fio.FioMap // Dirs that are only on the left LeftDirs *fio.FioMap // Files that are only on the left LeftFiles *fio.FioMap // Dirs that are only on the right RightDirs *fio.FioMap // Files that are only on the right RightFiles *fio.FioMap // Dirs that are identical on both sides CommonDirs *fio.FioPairMap // Files that are identical on both sides CommonFiles *fio.FioPairMap // Files/dirs that are different on both sides Diff *fio.FioPairMap // Funny entries Funny *fio.FioPairMap }
Difference captures the results of comparing two directory trees
func Diff ¶ added in v0.5.0
func Diff(lhs, rhs *fio.FioMap, opt ...Option) (*Difference, error)
Diff takes two file system trees represented by 'lhs' and 'rhs', and generates the differences between them. It is almost identical to FsTree above - except Diff doesn't do any disk I/O. As a result, the option WithWalkOption is not useful.
func FsTree ¶ added in v0.5.0
func FsTree(src, dst string, opt ...Option) (*Difference, error)
FsTree compares two file system trees 'src' and 'dst'. For regular files, it compares file size and mtime to determine change. For all entries, it compares every comparable attribute of fio.Info - unless explicitly ignored (by using the option WithIgnore()). The ignorable attributes are identified by IGN_xxx constants.
func (*Difference) String ¶
func (d *Difference) String() string
type Error ¶ added in v0.4.0
Error represents the errors returned by CloneFile, CloneMetadata and UpdateMetadata
type IgnoreFlag ¶
type IgnoreFlag uint
IgnoreFlag captures the attributes we want to ignore while comparing two fio.Info instances representing two filesystem entries on the two trees being compared.
const ( IGN_UID IgnoreFlag = 1 << iota // ignore uid IGN_GID // ignore gid IGN_XATTR // ignore xattr )
func (IgnoreFlag) String ¶ added in v0.4.0
func (f IgnoreFlag) String() string
type Observer ¶ added in v0.4.3
type Observer interface { VisitSrc(fi *fio.Info) VisitDst(fi *fio.Info) }
Observer is invoked when the comparator visits entries in src and dst.
type Option ¶ added in v0.4.0
type Option func(o *cmpopt)
Option captures the various options for cloning a directory tree.
func WithConcurrency ¶ added in v0.5.0
WithConcurrency limits the use of concurrent goroutines to n.
func WithDeepCompare ¶
WithDeepCompare provides a caller supplied comparison function that will be invoked if all other comparable attributes are identical.
func WithIgnoreAttr ¶ added in v0.4.0
func WithIgnoreAttr(fl IgnoreFlag) Option
WithIgnoreAttr captures the attributes of fio.Info that must be ignored for comparing equality of two filesystem entries.
func WithObserver ¶ added in v0.4.3
WithObserver uses 'ob' to report activities as the tree cloner makes progress
func WithWalkOptions ¶
WithWalkOptions uses 'wo' as the option for walk.Walk(); it describes a caller desired traversal of the file system with the requisite input and output filters