treefs

package
v0.24.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStopWalking = errors.Error("not walking")

Functions

func Print

func Print(fsys *DirFS, wr io.Writer) error

Types

type DirFS

type DirFS struct {
	Tree *DirTree
	// contains filtered or unexported fields
}

func NewDir

func NewDir(abs path.Absolute) (*DirFS, error)

NewDir returns a tree of only directories

func (*DirFS) Abs

func (t *DirFS) Abs(rel path.Relative) path.Absolute

func (*DirFS) Delete

func (m *DirFS) Delete(p path.Relative, recursive bool) error

func (*DirFS) Exists

func (t *DirFS) Exists(rel path.Relative) bool

func (*DirFS) Find

func (t *DirFS) Find(rel path.Relative) (tr *DirTree)

func (*DirFS) ModTime

func (m *DirFS) ModTime(p path.Relative) (t time.Time, err error)

func (*DirFS) Reader

func (m *DirFS) Reader(p path.Relative) (io.ReadCloser, error)

func (*DirFS) Rename

func (m *DirFS) Rename(p path.Relative, name string) error

func (*DirFS) Size

func (m *DirFS) Size(p path.Relative) int64

func (*DirFS) Write

func (m *DirFS) Write(p path.Relative, rd io.ReadCloser, recursive bool) (err error)

type DirTree

type DirTree struct {
	ModTime  time.Time
	Path     path.Relative
	Children []*DirTree
}

func (*DirTree) Has

func (t *DirTree) Has(p path.Relative) bool

func (*DirTree) Scan

func (t *DirTree) Scan(fsys fs.FS, callback func(path.Path, error) error) error

func (*DirTree) Walk

func (t *DirTree) Walk(callback func(depth int, p path.Relative, tr *DirTree) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL