ptree

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBar          = '│'
	DefaultFirstNode    = '├'
	DefaultBranchNode   = '├'
	DefaultBranchNodeTB = '┬'
	DefaultLastNode     = '└'
	DefaultLastNodeTB   = '┐'
	DefaultDash         = '─'
	DefaultFill         = ' '
	DefaultWidth        = 4
)

Default markers.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, root Node, config *Config) error

Types

type Config

type Config struct {
	Bar        rune // Marks downward no-branching connections.
	FirstNode  rune // Marks branches to the first child node.
	BranchNode rune // Marks branches to middle child nodes.
	LastNode   rune // Marks branches to the last child node.
	Dash       rune // Marks righward connections.
	Fill       rune // Marks the filler string.
	Width      int  // Gives the width.
	TB         bool // Print tree top to bottom.
}

func DefaultConfig

func DefaultConfig(tb bool) *Config

type Node

type Node interface {
	fmt.Stringer      // Name of the node.
	Children() []Node // List of the node's children.
}

Basic interface for tree views.

Jump to

Keyboard shortcuts

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