search

package
v1.10.42 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDupItem      = errors.New("duplicated item")
	ErrDupSlash     = errors.New("duplicated slash")
	ErrEmptyItem    = errors.New("empty item")
	ErrInvalidState = errors.New("search tree is in an invalid state")
	ErrNotFromRoot  = errors.New("path should start with /")

	NotFound Result
)

Functions

This section is empty.

Types

type Result

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

type Tree

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

func NewTree

func NewTree() *Tree

func (*Tree) Add

func (t *Tree) Add(route string, item interface{}) error

func (*Tree) Search

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

Jump to

Keyboard shortcuts

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