radix

package
v0.0.0-...-2c36af7 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 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 Edge

type Edge struct {
	Target *Node
	Label  string
}

func (Edge) String

func (r Edge) String() string

type EntryID

type EntryID string

type Node

type Node struct {
	Edges []Edge
	Ids   []EntryID
}

func (Node) FindPrefixedEntries

func (n Node) FindPrefixedEntries(max int) (entries []EntryID)

func (Node) IsLeaf

func (n Node) IsLeaf() bool

func (Node) Value

func (n Node) Value() []EntryID

type Tree

type Tree struct {
	Root *Node
}

func NewTree

func NewTree() *Tree

func (*Tree) FindWordsWithPrefix

func (r *Tree) FindWordsWithPrefix(key string, max int) []EntryID

func (*Tree) Get

func (r *Tree) Get(key string) []EntryID

func (*Tree) Insert

func (r *Tree) Insert(key string, id EntryID)

func (Tree) String

func (r Tree) String() string

Jump to

Keyboard shortcuts

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