Versions in this module Expand all Collapse all v0 v0.0.2 Apr 23, 2024 v0.0.1 Jan 31, 2024 Changes in this version + var ErrLinkCycleDetected = errors.New("cycle during symlink resolution") + var ErrLinkResolutionDepth = errors.New("maximum link resolution stack depth exceeded") + var ErrMaxTraversalDepth = errors.New("max allowable directory traversal depth reached (maybe a link cycle?)") + var ErrRemovingRoot = errors.New("cannot remove the root path (`/`) from the FileTree") + type Builder struct + func NewBuilder(tree Writer, index IndexWriter) *Builder + func (b *Builder) Add(metadata file.Metadata) (*file.Reference, error) + type Copier interface + Copy func() (ReadWriter, error) + type DepthFirstPathWalker struct + func NewDepthFirstPathWalker(tree *FileTree, visitor FileNodeVisitor, conditions *WalkConditions) *DepthFirstPathWalker + func (w *DepthFirstPathWalker) Visited(p file.Path) bool + func (w *DepthFirstPathWalker) Walk(from file.Path) (file.Path, *filenode.FileNode, error) + func (w *DepthFirstPathWalker) WalkAll() error + type FileNodeVisitor func(file.Path, filenode.FileNode) error + type FileTree struct + func New() *FileTree + func NewFileTree() *FileTree + func (t *FileTree) AddDir(realPath file.Path) (*file.Reference, error) + func (t *FileTree) AddFile(realPath file.Path) (*file.Reference, error) + func (t *FileTree) AddHardLink(realPath file.Path, linkPath file.Path) (*file.Reference, error) + func (t *FileTree) AddSymLink(realPath file.Path, linkPath file.Path) (*file.Reference, error) + func (t *FileTree) AllFiles(types ...file.Type) []file.Reference + func (t *FileTree) AllRealPaths() []file.Path + func (t *FileTree) Copy() (ReadWriter, error) + func (t *FileTree) Equal(other *FileTree) bool + func (t *FileTree) File(path file.Path, options ...LinkResolutionOption) (bool, *file.Resolution, error) + func (t *FileTree) FilesByGlob(query string, options ...LinkResolutionOption) ([]file.Resolution, error) + func (t *FileTree) HasPath(path file.Path, options ...LinkResolutionOption) bool + func (t *FileTree) ListPaths(dir file.Path) ([]file.Path, error) + func (t *FileTree) Merge(upper Reader) error + func (t *FileTree) PathDiff(other *FileTree) (extra, missing []file.Path) + func (t *FileTree) RemoveChildPaths(path file.Path) error + func (t *FileTree) RemovePath(path file.Path) error + func (t *FileTree) TreeReader() tree.Reader + func (t *FileTree) Walk(fn func(path file.Path, f filenode.FileNode) error, conditions *WalkConditions) error + type Index interface + func NewIndex() Index + type IndexEntry struct + type IndexReader interface + Basenames func() []string + Exists func(f file.Reference) bool + Get func(f file.Reference) (IndexEntry, error) + GetByBasename func(basenames ...string) ([]IndexEntry, error) + GetByBasenameGlob func(globs ...string) ([]IndexEntry, error) + GetByExtension func(extensions ...string) ([]IndexEntry, error) + GetByFileType func(fTypes ...file.Type) ([]IndexEntry, error) + GetByMIMEType func(mTypes ...string) ([]IndexEntry, error) + type IndexWriter interface + Add func(f file.Reference, m file.Metadata) + type LinkResolutionOption int + const DoNotFollowDeadBasenameLinks + const FollowBasenameLinks + type PathReader interface + AllRealPaths func() []file.Path + File func(path file.Path, options ...LinkResolutionOption) (bool, *file.Resolution, error) + FilesByGlob func(query string, options ...LinkResolutionOption) ([]file.Resolution, error) + HasPath func(path file.Path, options ...LinkResolutionOption) bool + ListPaths func(dir file.Path) ([]file.Path, error) + type ReadWriter interface + type Reader interface + AllFiles func(types ...file.Type) []file.Reference + TreeReader func() tree.Reader + type Searcher interface + SearchByGlob func(patterns string, options ...LinkResolutionOption) ([]file.Resolution, error) + SearchByMIMEType func(mimeTypes ...string) ([]file.Resolution, error) + SearchByPath func(path string, options ...LinkResolutionOption) (*file.Resolution, error) + func NewSearchContext(tree Reader, index IndexReader) Searcher + type UnionFileTree struct + func NewUnionFileTree() *UnionFileTree + func (u *UnionFileTree) PushTree(t ReadWriter) + func (u *UnionFileTree) Squash() (ReadWriter, error) + type WalkConditions struct + LinkOptions []LinkResolutionOption + ShouldContinueBranch func(file.Path, filenode.FileNode) bool + ShouldTerminate func(file.Path, filenode.FileNode) bool + ShouldVisit func(file.Path, filenode.FileNode) bool + type Walker interface + Walk func(fn func(path file.Path, f filenode.FileNode) error, conditions *WalkConditions) error + type Writer interface + AddDir func(realPath file.Path) (*file.Reference, error) + AddFile func(realPath file.Path) (*file.Reference, error) + AddHardLink func(realPath file.Path, linkPath file.Path) (*file.Reference, error) + AddSymLink func(realPath file.Path, linkPath file.Path) (*file.Reference, error) + Merge func(upper Reader) error + RemovePath func(path file.Path) error