router

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchPath

func MatchPath(requestPath, routePath string) bool

MatchPath implements the MVP routing rule: - exact match OR - prefix match on a segment boundary ("/path" matches "/path" and "/path/...")

Query strings are not considered (caller should pass URL.Path only).

Types

type MatchResult

type MatchResult struct {
	Route Route
}

type Route

type Route struct {
	Name   string
	Path   string
	Target string
}

type Router

type Router interface {
	Match(r *http.Request) (MatchResult, bool)
}

Jump to

Keyboard shortcuts

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