treefs

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	Generate(target string) (fs.File, error)
}

type Node

type Node struct {
	// contains filtered or unexported fields
}

func New

func New(name string) *Node

func (*Node) Children

func (n *Node) Children() (children []*Node)

Children returns a list of children, ordered alphanumerically.

func (*Node) Delete

func (n *Node) Delete(path ...string) (node *Node, found bool)

func (*Node) Entry

func (n *Node) Entry() fs.DirEntry

Entry returns node as a directory entry.

func (*Node) Find

func (n *Node) Find(path string) (node *Node, found bool)

func (*Node) FindByPrefix

func (n *Node) FindByPrefix(path string) (node *Node, prefix string, found bool)

func (*Node) Generate

func (n *Node) Generate(target string) (fs.File, error)

func (*Node) InsertDir

func (n *Node) InsertDir(path string, generator Generator) *Node

func (*Node) InsertFile

func (n *Node) InsertFile(path string, generator Generator) *Node

func (*Node) Mode

func (n *Node) Mode() fs.FileMode

func (*Node) Path

func (n *Node) Path() string

func (*Node) Print

func (n *Node) Print() string

Print the nodes in the tree.

Jump to

Keyboard shortcuts

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