Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/rogpeppe/hroute

Package hroute implements yet another HTTP route multiplexer. The design is strongly influenced by Julien Schmidt's httprouter package but the matching algorithm is more general and although httprouter was used to start the implementation, there is very little code left in common between the two. Specific differences from httprouter: - a specific pattern may override a more general pattern. For example, it will allow both "/:id" and "/debug" patterns to be registered. This applies to catch-all *name patterns too - the longest explicit match wins. Note that the pattern matching algorithm is not order dependent - no matter what order the patterns are registered in, the result will be the same. - it provides a facility for subroute handling - a Router can be used to serve a set of subroutes within a larger superstructure. - it provides a way to build paths from routes - the *Pattern value returned from Handle allows the reconstruction of a path from a registered route. - the handler type is an interface not a function, allowing clients to store and retrieve extra information from the router tree if needed. - it is possible to register a handler that will handle all methods by registering with the "*" method. This will be overridden be more specific method handlers. - much of the naming has also been changed to be more consistent with the net/http and its ServeMux type. - there is no case-insensitive path lookup.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/rogpeppe/hroute
License: BSD-3-Clause
Latest release: over 7 years ago
First release: over 7 years ago
Namespace: github.com/rogpeppe
Stars: 3 on GitHub
Forks: 1 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 6 days ago

    Loading...
    Readme
    Loading...