Documentation
¶
Overview ¶
Package nestedmatcher provides nested route matching semantics where one real path can resolve to multiple hierarchical route patterns.
It is intended for loader/layout-style routing where parent and leaf routes are accumulated together as one ordered match stack.
Index ¶
- type Match
- type Matcher
- func (m *Matcher) DynamicParamPrefix() rune
- func (m *Matcher) ExplicitIndexSegmentIdentifier() string
- func (m *Matcher) FindMatches(realPath string) (*Results, bool)
- func (m *Matcher) NormalizePattern(originalPattern string) *RegisteredPattern
- func (m *Matcher) RegisterPattern(originalPattern string) *RegisteredPattern
- func (m *Matcher) SplatSegmentIdentifier() rune
- type Options
- type Params
- type RegisteredPattern
- type Results
- type Segment
- type SegmentType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher resolves nested route matches.
func (*Matcher) DynamicParamPrefix ¶
DynamicParamPrefix returns the dynamic parameter prefix rune.
func (*Matcher) ExplicitIndexSegmentIdentifier ¶
ExplicitIndexSegmentIdentifier returns the explicit index marker.
func (*Matcher) FindMatches ¶
FindMatches resolves all nested matches for a real path.
func (*Matcher) NormalizePattern ¶
func (m *Matcher) NormalizePattern(originalPattern string) *RegisteredPattern
NormalizePattern validates and normalizes one input pattern.
func (*Matcher) RegisterPattern ¶
func (m *Matcher) RegisterPattern(originalPattern string) *RegisteredPattern
RegisterPattern registers one pattern for nested matching.
func (*Matcher) SplatSegmentIdentifier ¶
SplatSegmentIdentifier returns the splat segment identifier rune.
type Params ¶
type Params = matchercore.Params
Params stores dynamic path parameter values extracted from a match.
type RegisteredPattern ¶
type RegisteredPattern = matchercore.RegisteredPattern
RegisteredPattern is normalized metadata for one registered pattern.
type Results ¶
type Results = matchercore.FindNestedMatchesResults
Results stores nested match resolution output.
type Segment ¶
type Segment = matchercore.Segment
Segment is a normalized pattern segment and its classification.
type SegmentType ¶
type SegmentType = matchercore.SegmentType
SegmentType identifies what kind of route segment is represented.