route

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct{}

func NewFactory

func NewFactory() *Factory

type HeaderMatcher

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

HeaderMatcher handles header-based matching

func NewHeaderMatcher

func NewHeaderMatcher() *HeaderMatcher

func (*HeaderMatcher) Add

func (hm *HeaderMatcher) Add(headers map[string]string, route *Route)

func (*HeaderMatcher) Clear

func (hm *HeaderMatcher) Clear()

func (*HeaderMatcher) Match

func (hm *HeaderMatcher) Match(requestHeaders http.Header, candidateRoutes []*Route) []*Route

type MethodMatcher

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

func NewMethodMatcher

func NewMethodMatcher() *MethodMatcher

func (*MethodMatcher) Add

func (mm *MethodMatcher) Add(method string, route *Route)

func (*MethodMatcher) Clear

func (mm *MethodMatcher) Clear()

func (*MethodMatcher) Match

func (mm *MethodMatcher) Match(method string) []*Route

type PathMatcher

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

TODO: Use RadixTree for prefix matching for better performance

func NewPathMatcher

func NewPathMatcher(logger *logger.Logger) *PathMatcher

func (*PathMatcher) Add

func (pm *PathMatcher) Add(pattern string, route *Route)

func (*PathMatcher) Clear

func (pm *PathMatcher) Clear()

func (*PathMatcher) Match

func (pm *PathMatcher) Match(path string) []*Route

type Route

type Route struct {
	Plugins  *plugin.Chain
	Upstream *upstream.Upstream
}

func IntersectRoutes

func IntersectRoutes(r1, r2 []*Route) []*Route

Jump to

Keyboard shortcuts

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