Documentation
¶
Index ¶
- func Default[T comparable](v T, def T) T
- type FilterFn
- type Node
- type NodeType
- type Nodes
- type SearchFn
- type SortOrder
- type StringTreeArg
- type TransformFn
- type Tree
- func (t *Tree[T]) Empty() bool
- func (t *Tree[T]) ExactMatch(values []T) (*Node[T], bool)
- func (t *Tree[T]) Insert(values []T)
- func (t *Tree[T]) Match(values []T) (*Node[T], bool)
- func (t *Tree[T]) Name() string
- func (t *Tree[T]) PrintTo(w io.Writer)
- func (t *Tree[T]) Sort(order ...SortOrder)
- func (t *Tree[T]) SortOrder() SortOrder
- func (t *Tree[T]) Sorted() bool
- func (t *Tree[T]) Visit(values []T) *Node[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Default ¶
func Default[T comparable](v T, def T) T
Default return v or default if v has zero value
Types ¶
type NodeType ¶
type NodeType interface {
comparable
constraints.Ordered
}
NodeType constraint having comparable and Ordered constraint
type StringTreeArg ¶
type StringTreeArg struct {
Sep string
Name string
FnFilter FilterFn[string]
FnTransform TransformFn[string]
}
StringTreeArg for generating tree
type Tree ¶
type Tree[T NodeType] struct { // contains filtered or unexported fields }
Tree structure
func NewStringTree ¶
func NewStringTree(r io.Reader, arg StringTreeArg) *Tree[string]
NewStringTree with given name
func (*Tree[T]) ExactMatch ¶
Match all values
func (*Tree[T]) Sort ¶
Sort nodes in ASCENDING / DESCENDING order. If parameter is not specified, nodes will be sorted in ASCENDING order.
Click to show internal directories.
Click to hide internal directories.