summaryrefslogtreecommitdiff
path: root/pathrouter/catchallvariable.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-10-05 22:21:26 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-10-05 22:21:26 +0200
commit43a403b45d9644e634c2c560d16331305d83a4b0 (patch)
tree8ec3825579b388c205edfebed76b04906ae5368f /pathrouter/catchallvariable.go
parent6e5880aca9744d5e21434708f550f383400966e4 (diff)
downloadgo-gg-43a403b45d9644e634c2c560d16331305d83a4b0.tar.gz
pathrouter: remove type Context from public interface
Diffstat (limited to 'pathrouter/catchallvariable.go')
-rw-r--r--pathrouter/catchallvariable.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pathrouter/catchallvariable.go b/pathrouter/catchallvariable.go
index d1d3e2c..29947ab 100644
--- a/pathrouter/catchallvariable.go
+++ b/pathrouter/catchallvariable.go
@@ -4,16 +4,17 @@
package pathrouter
import (
+ "net/http"
"strings"
. "go.xyrillian.de/gg/option"
)
// CatchAllVariable is a [Matcher] that accepts subpaths with an arbitrary number of path elements.
-// The value of any amount of leading path elements will be collected into the [Context],
+// The value of any amount of leading path elements will be collected
+// (to be retrieved inside the request handler using [VariableValue]),
// such that the remainder is accepted by the next matcher.
// At least one element must be collected.
-// The full sequence of collected path elements can be retrieved with [Context.Variable].
//
// CatchAllVariable() may appear at any point within the routing tree,
// but it may not contain another CatchAllVariable() anywhere within it.
@@ -33,7 +34,7 @@ func catchAllVariable(name string, matcher realMatcher) Matcher {
panic("matcher within CatchAllVariable() may not accept unlimited path lengths")
}
- accept := func(path []string, rc Context) HandlerFunc {
+ accept := func(path []string, rc routingContext) http.HandlerFunc {
for length := innerMinLength; length <= innerMaxLength; length++ {
if length > len(path) {
break