Versions in this module Expand all Collapse all v0 v0.10.0 Apr 21, 2023 Changes in this version + const AttributeFormat + var GlobalFileTreeCollapse bool + func StackTreeRange(trees []*FileTree, start, stop int) (*FileTree, []PathError, error) + type Comparer struct + func NewComparer(refTrees []*FileTree) Comparer + func (cmp *Comparer) AggregatedIndexes() <-chan TreeIndexKey + func (cmp *Comparer) BuildCache() (errors []error) + func (cmp *Comparer) GetPathErrors(key TreeIndexKey) ([]PathError, error) + func (cmp *Comparer) GetTree(key TreeIndexKey) (*FileTree, error) + func (cmp *Comparer) NaturalIndexes() <-chan TreeIndexKey + type DiffType int + const Added + const Modified + const Removed + const Unmodified + func (diff DiffType) String() string + type EfficiencyData struct + CumulativeSize int64 + Nodes []*FileNode + Path string + type EfficiencySlice []*EfficiencyData + func Efficiency(trees []*FileTree) (float64, EfficiencySlice) + func (efs EfficiencySlice) Len() int + func (efs EfficiencySlice) Less(i, j int) bool + func (efs EfficiencySlice) Swap(i, j int) + type FileAction int + const ActionAdd + const ActionRemove + func (fa FileAction) String() string + type FileInfo struct + Gid int + IsDir bool + Linkname string + Mode os.FileMode + Path string + Size int64 + TypeFlag byte + Uid int + func NewFileInfo(realPath, path string, info os.FileInfo) FileInfo + func NewFileInfoFromTarHeader(reader *tar.Reader, header *tar.Header, path string) FileInfo + func (data *FileInfo) Compare(other FileInfo) DiffType + func (data *FileInfo) Copy() *FileInfo + type FileNode struct + Children map[string]*FileNode + Data NodeData + Name string + Parent *FileNode + Tree *FileTree + func NewNode(parent *FileNode, name string, data FileInfo) (node *FileNode) + func (node *FileNode) AddChild(name string, data FileInfo) (child *FileNode) + func (node *FileNode) AssignDiffType(diffType DiffType) error + func (node *FileNode) Copy(parent *FileNode) *FileNode + func (node *FileNode) IsLeaf() bool + func (node *FileNode) IsWhiteout() bool + func (node *FileNode) MetadataString() string + func (node *FileNode) Path() string + func (node *FileNode) Remove() error + func (node *FileNode) String() string + func (node *FileNode) VisitDepthChildFirst(visitor Visitor, evaluator VisitEvaluator) error + func (node *FileNode) VisitDepthParentFirst(visitor Visitor, evaluator VisitEvaluator) error + type FileTree struct + FileSize uint64 + Id uuid.UUID + Name string + Root *FileNode + Size int + func NewFileTree() (tree *FileTree) + func (tree *FileTree) AddPath(filepath string, data FileInfo) (*FileNode, []*FileNode, error) + func (tree *FileTree) CompareAndMark(upper *FileTree) ([]PathError, error) + func (tree *FileTree) Copy() *FileTree + func (tree *FileTree) GetNode(path string) (*FileNode, error) + func (tree *FileTree) RemovePath(path string) error + func (tree *FileTree) Stack(upper *FileTree) (failed []PathError, stackErr error) + func (tree *FileTree) String(showAttributes bool) string + func (tree *FileTree) StringBetween(start, stop int, showAttributes bool) string + func (tree *FileTree) VisibleSize() int + func (tree *FileTree) VisitDepthChildFirst(visitor Visitor, evaluator VisitEvaluator) error + func (tree *FileTree) VisitDepthParentFirst(visitor Visitor, evaluator VisitEvaluator) error + type NodeData struct + DiffType DiffType + FileInfo FileInfo + ViewInfo ViewInfo + func NewNodeData() *NodeData + func (data *NodeData) Copy() *NodeData + type PathError struct + Action FileAction + Err error + Path string + func NewPathError(path string, action FileAction, err error) PathError + func (pe PathError) String() string + type TreeIndexKey struct + func NewTreeIndexKey(bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop int) TreeIndexKey + func (index TreeIndexKey) String() string + type ViewInfo struct + Collapsed bool + Hidden bool + func NewViewInfo() (view *ViewInfo) + func (view *ViewInfo) Copy() (newView *ViewInfo) + type VisitEvaluator func(*FileNode) bool + type Visitor func(*FileNode) error