trie

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Leaf

type Leaf[T any] struct {
	Path  []string
	Value T
}

type Trie

type Trie[T any] struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func New

func New[T any]() *Trie[T]

func (*Trie[T]) Get

func (t *Trie[T]) Get(sequence []string) (value T, matched bool)

func (*Trie[T]) Leaves

func (t *Trie[T]) Leaves() (leaves []Leaf[T])

func (*Trie[T]) Partial

func (t *Trie[T]) Partial(sequence []string) (result []Leaf[T])

Get a list of all partial matches for a sequence, if any.

func (*Trie[T]) Set

func (t *Trie[T]) Set(sequence []string, value T)

Jump to

Keyboard shortcuts

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