tree

package
v0.0.0-...-bc789a4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ID       int
	Children []*Node
}

Node type defines a node of a tree

func Build

func Build(records []Record) (*Node, error)

Build function restructures the RecordList in a tree structure

func (*Node) Add

func (n *Node) Add(r Record) error

Add method adds a Record to the Node hierarchy

type Record

type Record struct {
	ID     int
	Parent int
}

Record type defines a record to be restructured

Jump to

Keyboard shortcuts

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