structure

package
v0.0.0-...-806eab8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTree

func BuildTree[T comparable, N HzmTree[T]](nodes []N) []N

Types

type BaseTree

type BaseTree[T comparable] struct {
	Id       T
	ParentId T
	Children []HzmTree[T]
}

func (*BaseTree[T]) AddChildren

func (b *BaseTree[T]) AddChildren(children ...HzmTree[T])

func (*BaseTree[T]) GetId

func (b *BaseTree[T]) GetId() T

func (*BaseTree[T]) GetParentId

func (b *BaseTree[T]) GetParentId() T

type HzmTree

type HzmTree[T comparable] interface {
	GetId() T
	GetParentId() T
	AddChildren(...HzmTree[T])
}

Jump to

Keyboard shortcuts

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