tree

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2026 Teradata

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package tree provides tree rendering (stub replacement for charm.land/lipgloss/v2/tree).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEnumerator

func DefaultEnumerator(children Children, index int) string

DefaultEnumerator is the default enumerator.

func DefaultIndenter

func DefaultIndenter(children Children, index int) string

DefaultIndenter is the default indenter.

func RoundedEnumerator

func RoundedEnumerator(children Children, index int) string

RoundedEnumerator uses rounded corners.

Types

type Children

type Children interface {
	Length() int
	At(i int) *Node
}

Children represents a list of child nodes.

type Enumerator

type Enumerator func(children Children, index int) string

Enumerator defines how to enumerate tree items.

type Indenter

type Indenter func(children Children, index int) string

Indenter defines how to indent tree levels.

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node represents a tree node.

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer configures tree rendering.

type Tree

type Tree struct {
	// contains filtered or unexported fields
}

Tree represents a tree structure.

func New

func New() *Tree

New creates a new tree.

func Root

func Root(value string) *Tree

Root sets the root value.

func (*Tree) Child

func (t *Tree) Child(items ...interface{}) *Tree

Child adds a child node.

func (*Tree) Enumerator

func (t *Tree) Enumerator(e Enumerator) *Tree

Enumerator sets the enumerator.

func (*Tree) EnumeratorStyle

func (t *Tree) EnumeratorStyle(s lipgloss.Style) *Tree

EnumeratorStyle sets enumerator style.

func (*Tree) EnumeratorStyleFunc

func (t *Tree) EnumeratorStyleFunc(fn func(children Children, i int) lipgloss.Style) *Tree

EnumeratorStyleFunc sets enumerator style function.

func (*Tree) Indenter

func (t *Tree) Indenter(i Indenter) *Tree

Indenter sets the indenter.

func (*Tree) Item

func (t *Tree) Item(item interface{}) *Tree

Item adds an item.

func (*Tree) ItemStyle

func (t *Tree) ItemStyle(s lipgloss.Style) *Tree

ItemStyle sets item style.

func (*Tree) ItemStyleFunc

func (t *Tree) ItemStyleFunc(fn func(children Children, i int) lipgloss.Style) *Tree

ItemStyleFunc sets item style function.

func (*Tree) Items

func (t *Tree) Items(items ...interface{}) *Tree

Items adds items to the tree.

func (*Tree) RootStyle

func (t *Tree) RootStyle(s lipgloss.Style) *Tree

RootStyle sets root style.

func (*Tree) String

func (t *Tree) String() string

String renders the tree.

Jump to

Keyboard shortcuts

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