dirtreefs

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 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 *FS, wr io.Writer) error

Types

type FS

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

func New

func New(abs path.Absolute) (*FS, error)

FS is a tree of only directories

func (*FS) Abs

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

func (*FS) Delete

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

func (*FS) Exists

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

func (*FS) Find

func (t *FS) Find(rel path.Relative) (tr *Tree)

func (*FS) ModTime

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

func (*FS) Reader

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

func (*FS) Rename

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

func (*FS) Size

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

func (*FS) Write

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

type Tree

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

func (*Tree) Has

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

func (*Tree) Scan

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

func (*Tree) Walk

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

Jump to

Keyboard shortcuts

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