Documentation
¶
Index ¶
- func Walker[T any, ID comparable, A ~func() Searchable[T, ID]](root Nodable[T, ID], nextNodesCb SearchableCallBack[T, ID], alg A)
- type FlatIndex
- type IndexableNode
- type MutableNode
- type Nodable
- type Node
- func (bn *Node[T, ID]) AddNode(node ...Nodable[T, ID])
- func (bn *Node[T, ID]) DeleteNode(node ...ID)
- func (bn Node[T, ID]) GetChilds() map[ID]Nodable[T, ID]
- func (bn Node[T, ID]) GetID() ID
- func (bn Node[T, ID]) GetValue() T
- func (bn *Node[T, ID]) Walk(alg Searchable[T, ID], cb SearchableCallBack[T, ID])
- type NodeIndex
- type Searchable
- type SearchableCallBack
- type SearchableFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Walker ¶
func Walker[T any, ID comparable, A ~func() Searchable[T, ID]](root Nodable[T, ID], nextNodesCb SearchableCallBack[T, ID], alg A)
Types ¶
type FlatIndex ¶
type FlatIndex[T any, ID comparable] struct { // contains filtered or unexported fields }
func (*FlatIndex[T, ID]) BuildIndex ¶
type IndexableNode ¶
type MutableNode ¶
type MutableNode[T any, ID comparable] interface { Nodable[T, ID] AddNode(node ...Nodable[T, ID]) DeleteNode(node ...string) }
type Nodable ¶
type Nodable[T any, ID comparable] interface { GetID() ID GetChilds() map[ID]Nodable[T, ID] GetValue() T }
type Node ¶
type Node[T any, ID comparable] struct { ID ID `yaml:"id" json:"id"` Nodes map[ID]Nodable[T, ID] `yaml:"nodes" json:"nodes"` Value T }
func (*Node[T, ID]) DeleteNode ¶
func (bn *Node[T, ID]) DeleteNode(node ...ID)
func (*Node[T, ID]) Walk ¶
func (bn *Node[T, ID]) Walk(alg Searchable[T, ID], cb SearchableCallBack[T, ID])
type Searchable ¶
type Searchable[T any, ID comparable] interface { Walk(root Nodable[T, ID], cb SearchableCallBack[T, ID]) }
func LevelOrderSearch ¶
func LevelOrderSearch[T any, ID comparable]() Searchable[T, ID]
type SearchableCallBack ¶
type SearchableCallBack[T any, ID comparable] func(node Nodable[T, ID]) error
type SearchableFunc ¶
type SearchableFunc[T any, ID comparable] func(root Nodable[T, ID], cb SearchableCallBack[T, ID])
func (SearchableFunc[T, ID]) Walk ¶
func (sf SearchableFunc[T, ID]) Walk(root Nodable[T, ID], cb SearchableCallBack[T, ID])
Click to show internal directories.
Click to hide internal directories.