search

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 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   interface{}
	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 interface{}) 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