A lightweight, fast, and extensible zero-allocation HTTP router for Go, designed for building customizable web frameworks.
LARS is a fast, radix-tree based HTTP router for Go that emphasizes speed, efficiency, and flexibility. It enables developers to create tailored web frameworks by offering a modular, interface-driven design without forcing a full-stack solution. It solves the problem of framework lock-in by providing building blocks for custom solutions.
Go developers building custom web frameworks or needing a high-performance, configurable router without the bloat of a full web framework. It's suitable for those who want control over their context and middleware design.
Developers choose LARS for its zero-allocation performance, customizable context interface that avoids lock-in, and unified middleware/handler definitions that simplify API design. Its smart route logic prevents inconsistent URL parameters, ensuring route consistency.
:rotating_light: Is a lightweight, fast and extensible zero allocation HTTP router for Go used to create customizable frameworks.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows developers to define their own context structs to pass framework-specific variables, avoiding vendor lock-in and enabling tailored solutions, as shown in the custom context example.
Built on a customized httprouter, benchmarks show zero allocations per operation, making it highly efficient for high-traffic applications with fast routing times.
Middleware and handlers have identical definitions, simplifying API design and reducing boilerplate code, as highlighted in the README's middleware examples.
Prevents adding inconsistent route parameters like :id vs :user_id, ensuring URL consistency and reducing routing errors in large applications.
Cannot register static and parameterized routes for the same path segment, restricting routing flexibility and potentially complicating certain URL structures.
Requires manual adjustments for Go 1.7's context integration with native http handlers, adding complexity and risk of errors, as noted in the 'Special Note' section.
The README admits middleware is limited to reusable examples, with others requiring copy-paste modification, indicating a smaller community-contributed library compared to full frameworks.