tree

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetChildren

func SetChildren[T any](node *Node[T], getChildValues func(node *Node[T]) ([]T, error)) error

Types

type Node

type Node[T any] struct {
	Value    T         `json:"value"`
	Children []Node[T] `json:"children"`
}

func QueryTree

func QueryTree[I, V any](
	input I,
	getRoots func(inputMsg I) ([]V, error),
	getChildren func(e *V) ([]V, error),
) ([]Node[V], error)

Jump to

Keyboard shortcuts

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