Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CmdWrapper ¶
CmdWrapper wraps *cobra.Command to implement the Named interface
func (CmdWrapper) GetName ¶
func (cmd CmdWrapper) GetName() string
GetName implements the Named interface required for the MapTree
type MapNode ¶
type MapNode[T Named] struct { Parent *MapNode[T] Children orderedMap[*MapNode[T]] Value T Depth int }
MapNode is a node in the tree data structure
type MapTree ¶
MapTree is a tree data structure
type Named ¶
type Named interface {
GetName() string
}
Named is an interface for stuff that has a name
type TreeFormatter ¶
type TreeFormatter[T Named] struct { NameFunc func(t *MapNode[T], indent int) string Indent int // contains filtered or unexported fields }
TreeFormatter formats trees
func NewTreeFormatter ¶
func NewTreeFormatter[T Named]( nameFunc func(t *MapNode[T], indent int) string, indent int, ) TreeFormatter[T]
NewTreeFormatter creates a new TreeFormatter
func (*TreeFormatter[T]) FormatTree ¶
func (f *TreeFormatter[T]) FormatTree(t *MapTree[T]) string
FormatTree formats a tree
Click to show internal directories.
Click to hide internal directories.