mux: add changelog and release v0.0.4
docs: create docs directory
Merge .github into a docs directory that can also contain other
documentation that shouldn't clutter up the root project directory.
design: add existing design documents to the repo
Previously these design documents were floating around on my hard drive.
To make sure I don't lose them, I have added them to the repo. This will
also hopefuly encourage drive-by patches to be more carefully thought
out since a lot of complexity is hidden behind the type system and the
relatively simple route matching rules in this muxer.
.github/workflows: add mirror workflow back
Using builds.sr.ht to sync the repos works quicker, but builds won't be
triggered unless a new ref is created. For example, if we 'git push
--delete origin somebranch', the build won't be run.
Fill in any gaps by leaving the nighly GitHub action in place for now.
.github, .builds: sync repo to GitHub quicker
.github/workflows: pin to commit SHA
mux: document restrictive route registration
.github: mirror repo to GitHub nightly
.github: auto close PRs
Automatically close PRs on the GitHub mirror of this repo
mux: fixes to new normalization example
Minor fixes to the normalization example in the package level
documentation to make sure the code would actually build, make things
clearer by removing unnecessary parts of the code, and use PRECIS
instead of lowercasing as a comment in the code had previously
mux: add normalization to documentation
Also minor tweaks to the examples to make them consistent with the
documentation, for instance, new instances of a router are now named
"serveMux" instead of "m" because it is likely that they will be used
far away from the original declaration and the single letter variable
name will lack context and be confusing.
mux: remove mostly useless return value from Param
Previously the Param function returned a bool that indicated whether the
parameter was actually found in the request context.
After looking over the examples in this package, and existing code that
I had written using this package I realized that it was never used.
If you've written a route with a parameter, and you've written a handler
to apply to that route, it's not likely that you'll be checking that the
handler applies to the route very often.
Even if you do have a handler that applies to several routes and acts
depending on the parameters that exist on the routes, the ok bool was
redundant as the same information can be found by checking whether a
Value exists on the returned ParamInfo.
mux: split docs out into separate doc.go file
mux: rename new normalization functions
Renaming "CanonicalPath" to "Path" and "WithParameter" to "WithParam"
keeps the identifiers short and is more consistent with the docs and
other identifiers in the package.
mux: add API to simplify path normalization
mux: update Handler docs for the newer behavior
mux: add test for request canonicalization
mux: fix code in package level docs
mux: add issue tracker link in readme
mux: don't embed node in ServeMux