treeview

package
v0.33.7 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package treeview renders a generic node tree to an io.Writer as an indented tree(1)-style ASCII tree using box-drawing connectors. It has no dependency on the snapshot source model, the cluster, or the filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(w io.Writer, root Node) error

Render writes the tree rooted at root to w using tree(1)-style box-drawing connectors. The root label is printed with no connector; nested entries use ├── / └── connectors with │ / space continuation indentation based on depth and last-sibling position. Output is deterministic for a given input.

Types

type Node

type Node struct {
	// Label is the display text for this node.
	Label string

	// Children are the direct child sub-trees rendered under this node.
	Children []Node

	// Volumes are leaf string entries rendered after Children under this node.
	Volumes []string
}

Node is an input-agnostic tree node. Callers map their domain model into this struct; the renderer imposes no dependency on k8s or internal snapshot packages.

Rendering order under any parent: Children are emitted first (in slice order), then Volumes (in slice order). All entries share the same last-sibling connector.

Jump to

Keyboard shortcuts

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