Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Difference ¶
type Difference struct { // Each of these maps uses a relative path as the key - it // is relative to the argument passed to NewTree(). Left map[string]*fio.Info Right map[string]*fio.Info // entries that are only on the left LeftOnly []string // entries that are only on the right RightOnly []string // Entries that are identical Same []string // entries that are different (size, perm, uid, gid, xattr) Diff []string // entries with same name on both sides but // are different (eg entry is a file on one side // but a directory in the other) Funny []string }
Difference captures the results of comparing two trees
func DirCmp ¶
func DirCmp(lhs, rhs *Tree, op ...Opt) (*Difference, error)
DirCmp compares two directory trees represented by "lhs" and "rhs". 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()).
func (*Difference) String ¶
func (d *Difference) String() string
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_HARDLINK // ignore hardlink count IGN_XATTR // ignore xattr )
type Opt ¶
type Opt func(o *opt)
Opt is an option operator for DirCmp.
func WithDeepCompare ¶
WithDeepCompare provides a caller supplied comparison function that will be invoked if all other comparable attributes are identical.
func WithIgnore ¶
func WithIgnore(fl IgnoreFlag) Opt
WithIgnore captures the attributes of fio.Info that must be ignored for comparing equality of two filesystem entries.
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree represents a file system "tree" traversal object
type TreeOpt ¶
type TreeOpt func(o *treeopt)
TreeOpt is an option operator for constructing a filesystem tree object (Tree)
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