Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintNode ¶ added in v0.2.3
func PrintNode[T comparable](node Node[T], options PrintOptions) string
PrintNode recursively prints node
Types ¶
type Node ¶ added in v0.2.3
type Node[T comparable] interface { ToString() string // ToString returns node self information Parent() T // Parent returns parent node or nil NumChild() int // NumChild returns number of child GetChildByIndex(i int) T // GetChildByIndex gets child by index }
Node represents a generic printable node
type Pair ¶ added in v0.1.0
type Pair[T1, T2 any] struct { First T1 Second T2 }
Pair contains two values like c++ std::pair
type PrintOptions ¶ added in v0.2.3
type PrintOptions struct { Prefix string IconParent string // default "│ " IconSpace string // default " " IconBranch string // default "├──" IconLastBranch string // default "└──" }
PrintOptions represents a options for printing Node
func (*PrintOptions) Fix ¶ added in v0.2.3
func (options *PrintOptions) Fix()
Click to show internal directories.
Click to hide internal directories.