A fast, radix-tree based HTTP router for Go that strictly adheres to the standard net/http package.
Pure is a lightweight HTTP router for Go that uses a radix-tree for fast routing while strictly adhering to the standard net/http package. It solves the need for a high-performance router that maintains Go's idiomatic patterns, leveraging the context package for request-scoped data without wrapping native handlers.
Go developers building web applications or APIs who want a fast, efficient router that integrates seamlessly with the standard library and avoids framework lock-in.
Developers choose Pure for its balance of speed, simplicity, and adherence to Go conventions, offering a minimal abstraction layer over net/http with features like radix-tree routing and built-in request decoding.
:non-potable_water: Is a lightweight HTTP router that sticks to the std "net/http" implementation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Seamlessly integrates with Go's net/http package, allowing use of standard handlers and middleware without abstraction layers, as highlighted in the philosophy section.
Uses a custom radix tree based on httprouter, with benchmarks showing low latency and efficient memory usage, such as 24.77 ns/op for static routes.
Reduces context lookup overhead by storing multiple request-scoped variables in a single interface, improving performance for parameter-heavy routes, as explained in the RequestVars section.
Supports JSON, XML, FORM, Multipart Form, and url.Values decoding out of the box, minimizing boilerplate for common request types via the Decode function.
Allows route grouping with inherited or custom middleware configurations, enabling organized and reusable middleware chains, demonstrated in the Groups examples.
Focuses only on routing and basic decoding; lacks built-in support for sessions, authentication, or WebSockets, requiring additional libraries for full-featured applications.
Has fewer third-party middleware and community contributions compared to popular alternatives like Gin, which can increase development time for custom integrations.
The custom implementation imposes limitations, such as no static and dynamic routes for the same path segment, which the README admits can be restrictive for some routing patterns.
Heavy reliance on Go's context package for request-scoped data may introduce a learning curve and overhead for developers unfamiliar with context patterns or maintaining legacy code.