Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintLargestDiffs ¶
func WalkAddTreeDiff ¶
func WalkAddTreeDiff(t *tree.FileTree, d *ScanDiff, newTreeAllHash *[]byte, addedTrees []TreeDiff, addedFiles []FileDiff) (removeThisTree bool)
Adds a `TreeDiff` onto a `FileTree`, returning the resultant `FileTree`
NOTE: Assumes the `FileTree` and `TreeDiff` have the same root
Types ¶
type FileDiff ¶
type FileDiff struct { NewerName string NewerErr string Type DiffType HashDiff utility.HashLocation SizeDiff int64 LastModifiedDiff time.Duration }
Contains the differences between two `File`s
type ScanDiff ¶
type ScanDiff struct { AllHash []byte // Only populated at depth == 0 Trees map[string]TreeDiff Files map[string]FileDiff }
The "root" ds for a scan diff, contains all detected file/tree differences, their paths (as map keys) and an array containing all new file hash values
func AddDiffsForPath ¶
For a given path, and each index between `firstIdx` and `lastIdx` (of recorded diffs) accumulate the "diff"s into a single "diff"
TODO: I think this is missing some error conditions
func CompareTrees ¶
Compare two trees and store their differences in an output `ScanDiff`
func ReadBinary ¶
func (*ScanDiff) AddDiff ¶
Adds the changes in `new` to diff `s`. So that we can do, for example:
s1 + diff(s1, s2) + diff(s2, s3) == s3
TODO: Currently not working
func (*ScanDiff) WriteBinary ¶
type TreeDiff ¶
type TreeDiff struct { DiffCompleted time.Time Comprehensive bool Type DiffType // Non-recursive data OriginalPath string NewerPath string DepthDiff int ErrStringsDiff []string FilesDiff []FileDiff FilesDiffIndices []int LastVisitedDiff time.Duration TimeTakenDiff time.Duration LastModifiedDiffDirect time.Duration SizeDiffDirect int64 NumFilesTotalDiffDirect int64 // Recursive data SubTreesDiff []TreeDiff SubTreesDiffIndices []int AllHash []byte // Only populated at depth == 0 AllHashOffset int64 }
Captures the differences between two `FileTree`s