chi - lightweight, idiomatic and composable router for building Go HTTP services

  •        39

chi is a lightweight, idiomatic and composable router for building Go 1.7+ HTTP services. It's especially good at helping you write large REST API services that are kept maintainable as your project grows and changes. chi is built on the new context package introduced in Go 1.7 to handle signaling, cancelation and request-scoped values across a handler chain.The focus of the project has been to seek out an elegant and comfortable design for writing REST API servers, written during the development of the Pressly API service that powers our public API service, which in turn powers all of our client-side applications.

https://github.com/go-chi/chi

Tags
Implementation
License
Platform

   




Related Projects

goji - Goji is a minimalistic and flexible HTTP request multiplexer for Go (golang)


Goji is a HTTP request multiplexer, similar to net/http.ServeMux. It compares incoming requests to a list of registered Patterns, and dispatches to the http.Handler that corresponds to the first matching Pattern. Goji also supports Middleware (composable shared functionality applied to every request) and uses the standard context package to store request-scoped values.Please refer to Goji's GoDoc Documentation for a full API reference.

Gin - HTTP web framework written in Go (Golang)


Gin is a web framework written in Go (Golang). It features a martini-like API with much better performance, up to 40 times faster thanks to httprouter. If you need performance and good productivity, you will love You can add global, per-group, and per-route middlewares, thousands of nested groups, nice JSON validation and rendering. And the performance will be still great. Gin uses httprouter internally, the fastest HTTP router for Golang. Httprouter was created by Julien Schmidt and it’s based in a Radix Tree algorithm.

web - Go Router + Middleware. Your Contexts.


gocraft/web is a Go mux and middleware package. We deal with casting and reflection so YOUR code can be statically typed. And we're fast.Performance is a first class concern. Every update to this package has its performance measured and tracked in BENCHMARK_RESULTS.

fabio - A fast, modern, zero-conf load balancing HTTP(S) router for deploying microservices managed by consul


fabio is a fast, modern, zero-conf load balancing HTTP(S) and TCP router for deploying applications managed by consul.Register your services in consul, provide a health check and fabio will start routing traffic to them. No configuration required. Deployment, upgrading and refactoring has never been easier. It integrates with Consul, Vault, Amazon ELB, Amazon API Gateway and more.

interpose - Minimalist net/http middleware for golang


Interpose is a minimalist net/http middleware framework for golang. It uses http.Handler as its core unit of functionality, minimizing complexity and maximizing inter-operability with other middleware frameworks.All that it does is manage middleware. It comes with nothing baked in. You bring your own router, etc. See below for some well-baked examples.



httprouter - A high performance HTTP request router that scales well


HttpRouter is a lightweight high performance HTTP request router (also called multiplexer or just mux for short) for Go.In contrast to the default mux of Go's net/http package, this router supports variables in the routing pattern and matches against the request method. It also scales better.

httptreemux - High-speed, flexible tree-based HTTP router for Go.


High-speed, flexible, tree-based HTTP router for Go.This is inspired by Julien Schmidt's httprouter, in that it uses a patricia tree, but the implementation is rather different. Specifically, the routing rules are relaxed so that a single path segment may be a wildcard in one route and a static token in another. This gives a nice combination of high performance with a lot of convenience in designing the routing patterns. In benchmarks, httptreemux is close to, but slightly slower than, httprouter.

lars - :rotating_light: Is a lightweight, fast and extensible zero allocation HTTP router for Go used to create customizable frameworks


Have you ever been painted into a corner by a framework, ya me too! and I've noticed that allot of routers out there, IMHO, are adding so much functionality that they are turning into Web Frameworks, (which is fine, frameworks are important) however, not at the expense of flexibility and configurability. So with no further ado, introducing LARS an HTTP router that can be your launching pad in creating a framework for your needs. How? Context is an interface see example here, where you can add as little or much as you want or need and most importantly...under your control.Note: Since this router has only explicit matches, you can not register static routes and parameters for the same path segment. For example you can not register the patterns /user/new and /user/:user for the same request method at the same time. The routing of different request methods is independent from each other. I was initially against this, and this router allowed it in a previous version, however it nearly cost me in a big app where the dynamic param value say :type actually could have matched another static route and that's just too dangerous, so it is no longer allowed.

bone - Lightning Fast HTTP Multiplexer


These test are just for fun, all these router are great and really efficient. Bone do not pretend to be the fastest router for every job.

go-web-framework-benchmark - :zap: Go web framework benchmark


This benchmark suite aims to compare the performance of Go web frameworks. It is inspired by Go HTTP Router Benchmark but this benchmark suite is different with that. Go HTTP Router Benchmark suit aims to compare the performance of routers but this Benchmark suit aims to compare whole HTTP request processing.

Kong - The Microservice API Gateway


Kong is a cloud-native, fast, scalable, and distributed Microservice Abstraction Layer (also known as an API Gateway, API Middleware or in some cases Service Mesh). Backed by the battle-tested NGINX with a focus on high performance, Kong was made available as an open-source platform in 2015. Under active development, Kong is used in production at thousands of organizations from startups, Global 5000 and Government organizations.

go-http-routing-benchmark - Go HTTP request router and web framework benchmark


This benchmark suite aims to compare the performance of HTTP request routers for Go by implementing the routing structure of some real world APIs. Some of the APIs are slightly adapted, since they can not be implemented 1:1 in some of the routers.Of course the tested routers can be used for any kind of HTTP request → handler function routing, not only (REST) APIs.

skipper - An HTTP router and reverse proxy for service composition


Skipper is an HTTP router and reverse proxy for service composition. It's designed to handle >100k HTTP route definitions with detailed lookup conditions, and flexible augmentation of the request flow with filters. It can be used out of the box or extended with custom lookup, filter logic and configuration sources.Skipper provides a default executable command with a few built-in filters. However, its primary use case is to be extended with custom filters, predicates or data sources. Go here for additional documentation.

httpexpect - End-to-end HTTP and REST API testing for Go.


Concise, declarative, and easy to use end-to-end HTTP and REST API testing for Go (golang).Basically, httpexpect is a set of chainable builders for HTTP requests and assertions for HTTP responses and payload, on top of net/http and several utility packages.

pat


It's that simple.The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

express-gateway - A microservices API Gateway built on top of ExpressJS


Express Gateway is an API Gateway that sits at the heart of any microservices architecture, regardless of what language or platform you're using. Express Gateway secures your microservices and exposes them through APIs using Node.js, ExpressJS and Express middleware. Developing microservices, orchestrating and managing them now can be done insanely fast all on one seamless platform without having to introduce additional infrastructure. Express Gateway is commerically supported LunchBadger. For more information about support plans please contact info@express-gateway.io.

armeria - Asynchronous RPC/REST library built on top of Java 8, Netty, HTTP/2, Thrift and gRPC


Visit the official web site for more information.Armeria is an open-source asynchronous RPC/API client/server library built on top of Java 8, Netty 4.1, HTTP/2, Thrift and gRPC. Its primary goal is to help engineers build high-performance asynchronous microservices that use HTTP/2 as a session layer protocol.

slack - Slack API in Go


This library supports most if not all of the api.slack.com REST calls, as well as the Real-Time Messaging protocol over websocket, in a fully managed way.This is released before adding context support. As the used context package is the one from Go 1.7 this will be the last compatible with Go < 1.7.

go-jwt-middleware - A Middleware for Go Programming Language to check for JWTs on HTTP requests


A middleware that will check that a JWT is sent on the Authorization header and will then set the content of the JWT into the user variable of the request.This module lets you authenticate HTTP requests using JWT tokens in your Go Programming Language applications. JWTs are typically used to protect API endpoints, and are often issued using OpenID Connect.