Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SyntaxError = errors.New("Syntax error in surefile")
Functions ¶
func CompareTrees ¶
func CompareTrees(older, newer *Tree)
Traverse an old tree and a new tree, printing out everything that is different between them.
func MigrateHashes ¶
func MigrateHashes(oldTree, newTree *Tree)
Migrate hashes from oldTree to newTree. Any files that are the same in the oldTree as the newTree will have their hash migrated to the new tree.
Types ¶
type AttMap ¶
type AttMap interface {
GetKind() string
}
AttMap defines an interface to general attributes for file nodes.
type Comparer ¶
type Comparer struct {
// contains filtered or unexported fields
}
The Comparer is a writer where the diffs between two trees will be written.
func NewComparer ¶
func (Comparer) CompareTrees ¶
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
A progress meter. Records files visited, and number of bytes processed. When given an estimate, prints a simple periodic report of how far along we think we are.
type PushDecoder ¶
type PushDecoder struct {
// contains filtered or unexported fields
}
A PushDecoder is a stateful decoder that can be given a surefile one line at a time, and generate the full tree.
func NewPushDecoder ¶
func NewPushDecoder() *PushDecoder
func (*PushDecoder) Add ¶
func (pd *PushDecoder) Add(line string) error
Add adds a line to the push decoder.
func (*PushDecoder) Tree ¶
func (pd *PushDecoder) Tree() (*Tree, error)
Tree extracts the tree from the push decoder. Returns an error if a full surefile wasn't pushed to it.
type RegAtts ¶
type Tree ¶
A directory tree node.
func GenerateTree ¶
Generate a random tree for testing.
func ScanFs ¶
Walk a directory tree, generating a tree structure for it. All attributes are filled in that can be gleaned through lstat (and possibly readlink). The files themselves are not opened.
func (*Tree) ComputeHashes ¶
Update all of the file nodes that don't have hashes.
func (*Tree) EstimateHashes ¶
Estimate the amount of updates necessary to files hashes.