Documentation ¶
Index ¶
- Constants
- func CreateFolder(root Node, path string) bool
- func DeleteEmptyFolders(folder Folder)
- func Display(l esl.Logger, node Node)
- func MaxDepth(node Node) int
- func SumFileSize(node Node) int64
- func SumNumFiles(node Node) int
- func SumNumNode(node Node) int
- type File
- type Folder
- type Node
- type NodeType
Constants ¶
View Source
const (
ExtraDataContentSeed = "content_seed"
)
Variables ¶
This section is empty.
Functions ¶
func CreateFolder ¶
Create folders. returns false if failed to create.
func DeleteEmptyFolders ¶
func DeleteEmptyFolders(folder Folder)
func SumFileSize ¶
func SumNumFiles ¶
func SumNumNode ¶
Types ¶
type File ¶
type Folder ¶
type Folder interface { Node // Returns descendant nodes. Descendants() []Node // Add node under this folder. // This will replace existing node by name. Add(node Node) // Delete node by name. Returns false if the node not found. Delete(name string) bool // Compare nodes and descendants. DeepEquals(x Node) bool // Number of files. Does not include files under descendants NumFiles() int // Number of folders. Does not include folders under descendants NumFolders() int }
type Node ¶
type Node interface { // Name of the node. Name() string // Node type Type() NodeType // Compare nodes. Equals(x Node) bool // Extra data for serialize node state ExtraData() map[string]interface{} // Rename this node Rename(newName string) }
func ResolvePath ¶
Returns a Node of the path. Returns nil if the node not found for the path.
Click to show internal directories.
Click to hide internal directories.