matcher

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsRelative

func AsRelative(route string) string

Types

type Matchable

type Matchable interface {
	URI() string
	Namespaces() []string
}

type Matcher

type Matcher struct {
	Nodes      []*Node
	Matchables []Matchable
	// contains filtered or unexported fields
}

func NewMatcher

func NewMatcher(matchables []Matchable) *Matcher

func (*Matcher) MatchAll

func (m *Matcher) MatchAll(namespace, URI string) []Matchable

func (*Matcher) MatchOne

func (m *Matcher) MatchOne(namespace, URI string) (Matchable, error)

func (*Matcher) MatchPrefix

func (m *Matcher) MatchPrefix(method string, uriPath string) ([]Matchable, error)

type Node

type Node struct {
	Matched         []int
	ExactChildren   []*Node
	WildcardMatcher *Node
	// contains filtered or unexported fields
}

func NewNode

func NewNode() *Node

func (*Node) Add

func (n *Node) Add(routeIndex int, uri string)

func (*Node) Match

func (n *Node) Match(method, route string, exact bool, dest *[]*Node)

type NodeMatch

type NodeMatch struct {
	URL  string
	Node *Node
}

Jump to

Keyboard shortcuts

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