shared

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package shared provides utilities and common functionality for TreeView v2 examples.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTerminal

func ClearTerminal()

ClearTerminal clears the terminal screen

func CreateBasicTreeNodes

func CreateBasicTreeNodes() *treeview.Node[string]

CreateBasicTreeNodes creates a simple tree structure for basic examples.

func RunExampleStepsWithDelay

func RunExampleStepsWithDelay(title string, steps []ExampleStep, delaySeconds int)

RunExampleStepsWithDelay runs a series of example steps with a title and custom delay. The delay parameter specifies seconds between steps (0 for no delay).

func WaitDelay

func WaitDelay(defaultDelay float64)

WaitDelay waits for the specified number of seconds

func WaitDelayThenClearTerminal

func WaitDelayThenClearTerminal(seconds float64)

ClearTerminal clears the terminal screen

Types

type ExampleStep

type ExampleStep struct {
	Name string
	Func func() (string, error)
}

ExampleStep represents a single step in an example.

Jump to

Keyboard shortcuts

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