From d2de069dd272447d0709beccd5afda7431a9021e Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Sun, 18 Oct 2026 19:39:07 +0200 Subject: pathrouter: add TODOs for APIs that I want to add --- go.mod | 1 - pathrouter/matcher.go | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 92a742a..45c9ab1 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,3 @@ module go.xyrillian.de/gg -// TODO for 1.27: add pathrouter.Context.Value[T]() go 1.27 diff --git a/pathrouter/matcher.go b/pathrouter/matcher.go index 0ddd7f6..4dd3550 100644 --- a/pathrouter/matcher.go +++ b/pathrouter/matcher.go @@ -79,6 +79,10 @@ var ( _ url.URL ) +// TODO: new Matcher that introduces a Middleware which runs if a contained route matches (similar to how Variable() modifies routingContext on successful accept) +// TODO: store typed precomputed values in routingContext (func ComputedValue[T any](*http.Request) T and SetComputedValue analogously) +// TODO: then add Middleware variant that computes a value as func(*http.Request) T (e.g. to extract AuthN information from headers into an object of type Session etc.) + // Matcher is the common type for any actor that can inspect the path of a request URL (or a suffix of it) // and either accept or decline to handle the request. // -- cgit v1.3.1