filetree

package
v0.1.2093 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2018 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpecialCase func(path string) bool

SpecialCase is a function you can pass to NewTree in order to override the behavior when marshalling a node.

Functions

This section is empty.

Types

type Node

type Node struct {
	FullPath string      `json:"full_path"`
	Info     os.FileInfo `json:"-"`
	Children []*Node     `json:"-"`
	Parent   *Node       `json:"-"`
}

Node represents a leaf in the filetree

func NewTree

func NewTree(rootPath string) (*Node, error)

NewTree creates a new filetree starting at the root

func (Node) MarshalYAML

func (n Node) MarshalYAML() (interface{}, error)

MarshalYAML serializes the tree into YAML

type PathNodes

type PathNodes struct {
	Map  map[string]*Node
	Keys []string
}

PathNodes is a map of filepaths to tree nodes with ordered path keys.

Jump to

Keyboard shortcuts

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