Help us shape the future of Go! Take the 2026 Go Developer Survey

search

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 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 Result

type Result struct {
	Item   any
	Params map[string]string
}

A Result is a search result from tree.

var (

	// NotFound is used to hold the not found result.
	NotFound Result
)

type Tree

type Tree struct {
	// contains filtered or unexported fields
}

A Tree is a search tree.

func NewTree

func NewTree() *Tree

NewTree returns a Tree.

func (*Tree) Add

func (t *Tree) Add(route string, item any) error

Add adds item to associate with route.

func (*Tree) Search

func (t *Tree) Search(route string) (Result, bool)

Search searches item that associates with given route.

Jump to

Keyboard shortcuts

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