tree

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 8 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(cache cache.Interface, target string) (*virt.File, error)
}

type Match

type Match struct {
	Path string
	Mode Mode
	// contains filtered or unexported fields
}

func (*Match) Generate

func (m *Match) Generate(cache cache.Interface, target string) (*virt.File, error)

type Mode

type Mode uint8
const (
	ModeDir Mode = 1 << iota
	ModeGen
	ModeGenDir = ModeGen | ModeDir
)

func (Mode) FileMode

func (m Mode) FileMode() fs.FileMode

func (Mode) IsDir

func (m Mode) IsDir() bool

func (Mode) IsGen

func (m Mode) IsGen() bool

func (Mode) IsGenDir

func (m Mode) IsGenDir() bool

func (Mode) IsGenFile

func (m Mode) IsGenFile() bool

func (Mode) String

func (m Mode) String() string

type Node

type Node struct {
	Name       string
	Mode       Mode
	Generators []Generator
	// contains filtered or unexported fields
}

func (*Node) Children

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

func (*Node) Format

func (n *Node) Format() string

func (*Node) Print

func (n *Node) Print(tree treeprint.Tree) string

type Tree

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

func New

func New() *Tree

func (*Tree) Delete

func (t *Tree) Delete(fpath string)

func (*Tree) Find

func (t *Tree) Find(fpath string) (*Match, bool)

func (*Tree) FindPrefix

func (t *Tree) FindPrefix(fpath string) (*Match, bool)

func (*Tree) GenerateDir

func (t *Tree) GenerateDir(fpath string, generator Generator) error

func (*Tree) GenerateFile

func (t *Tree) GenerateFile(fpath string, generator Generator) error

func (*Tree) Print

func (t *Tree) Print() string

Jump to

Keyboard shortcuts

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