Categorygithub.com/a8m/tree
modulepackage
0.0.0-20240104212747-2c8764a5f17e
Repository: https://github.com/a8m/tree.git
Documentation: pkg.go.dev

# README

tree Build status License

An implementation of the tree command written in Go, that can be used programmatically.

tree command

Installation:

$ go get github.com/a8m/tree/cmd/tree

How to use tree programmatically ?

You can take a look on cmd/tree, and s3tree or see the example below.

import (
    "github.com/a8m/tree"
)

func main() {
    opts := &tree.Options{
        // Fs, and OutFile are required fields.
        // fs should implement the tree file-system interface(see: tree.Fs),
        // and OutFile should be type io.Writer
        Fs: fs,
        OutFile: os.Stdout,
        // ...
    }
    inf.New("root-dir")
    // Visit all nodes recursively
    inf.Visit(opts)
    // Print nodes 
    inf.Print(opts)
}

License

MIT

# Packages

No description provided by the author
No description provided by the author

# Functions

ANSIColor.
ANSIColorFormat.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NaturalLess compares two strings using natural ordering.
New get path and create new node(root).
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
Not used, remove.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
Node represent some node in the tree contains FileInfo, and its childs.
Options store the configuration for specific tree.

# Interfaces

To use this package programmatically, you must implement this interface.

# Type aliases

List of nodes.
No description provided by the author