summaryrefslogtreecommitdiff
path: root/router.go
AgeCommit message (Collapse)Author
2023-09-30file serving refactortjpcc
* do away with fs.FS usage in gemini, like the previous refactor in gopher * remove spartan code in contrib * standardize fsroot/urlroot string arguments to file serving handlers
2023-09-17allow mounted sub-routers to own the root path without a trailing slashtjpcc
2023-09-16add a docstring note about root paths in mounted sub-routersv1.3.3tjpcc
2023-05-01fix the router.Handler signaturetjpcc
2023-05-01docstring fixtjpcc
2023-05-01name change gus -> slideruletjpcc
2023-02-15Switch Handler to an interface.tjpcc
HandlerFunc is much better as a function returning a Handler, rather than a newtype for the function type itself. This way there is no confusion creating a type-inferenced variable with HandlerFunc(func(... and then using a HandlerFunc where a Handler is expected. Much better to only have one public type.
2023-02-14no need to combine sub-router params any moretjpcc
2023-02-14Router improvements.tjpcc
- test coverage for Router, not just PathTree - Router.Mount() now flattens routes into the parent router - Router.Use() implemented to set middleware on a router itself
2023-02-02Mount() adds a subrouter under a prefix pattern.tjpcc
...though I'm already eyeing a better approach.
2023-02-02Initial Router work.tjpcc
- Router type, supports: adding handlers, serving, fetching the matching handler for a route. - Private PathTree type handles the modified radix trie.