go-zoo / Bone
Licence: mit
Lightning Fast HTTP Multiplexer
Stars: ✭ 1,270
Programming Languages
go
31211 projects - #10 most used programming language
Projects that are alternatives of or similar to Bone
rux
⚡ Rux is an simple and fast web framework. support route group, param route binding, middleware, compatible http.Handler interface. 简单且快速的 Go api/web 框架,支持路由分组,路由参数绑定,中间件,兼容 http.Handler 接口
Stars: ✭ 81 (-93.62%)
Mutual labels: router, mux
Mux
A powerful HTTP router and URL matcher for building Go web servers with 🦍
Stars: ✭ 15,667 (+1133.62%)
Mutual labels: mux, router
Httprouter
A high performance HTTP request router that scales well
Stars: ✭ 13,500 (+962.99%)
Mutual labels: mux, router
Mux
A high performance and powerful trie based url path router for Go.
Stars: ✭ 487 (-61.65%)
Mutual labels: mux, router
Highway
Highway - A Modern Javascript Transitions Manager
Stars: ✭ 1,185 (-6.69%)
Mutual labels: router
Ng2 Breadcrumbs
A breadcrumb service for the Angular 7 router
Stars: ✭ 61 (-95.2%)
Mutual labels: router
Hookrouter
The flexible, and fast router for react that is entirely based on hooks
Stars: ✭ 1,200 (-5.51%)
Mutual labels: router
Service Worker Router
➰ An elegant and fast URL router for service workers (and standalone use)
Stars: ✭ 70 (-94.49%)
Mutual labels: router
Actions Openwrt K2p
Use Github Actions to automatically compile Lean's Modified Lede source for K2P
Stars: ✭ 67 (-94.72%)
Mutual labels: router
Nettygateway
NettyGateway is a HTTP proxy server with flexible routing rules.
Stars: ✭ 73 (-94.25%)
Mutual labels: router
Route Recognizer
Recognizes URL patterns with support for dynamic and wildcard segments
Stars: ✭ 65 (-94.88%)
Mutual labels: router
Corenavigation
📱📲 Navigate between view controllers with ease. 💫 🔜 More stable version (written in Swift 5) coming soon.
Stars: ✭ 69 (-94.57%)
Mutual labels: router
Koatty
Koa2 + Typescript = Koatty. Use Typescript's decorator implement IOC and AOP.
Stars: ✭ 67 (-94.72%)
Mutual labels: router
Livebox 0day
Arcadyan ARV7519RW22-A-L T VR9 1.2 Multiple security vulnerabilities affecting latest firmware release on ORANGE Livebox modems.
Stars: ✭ 68 (-94.65%)
Mutual labels: router
bone
What is bone ?
Bone is a lightweight and lightning fast HTTP Multiplexer for Golang. It support :
- URL Parameters
- REGEX Parameters
- Wildcard routes
- Router Prefix
- Route params validators
- Sub Router,
mux.SubRoute()
, support most standard router (bone, gorilla/mux, httpRouter etc...) - Http method declaration
- Support for
http.Handler
andhttp.HandlerFunc
- Custom NotFound handler
- Respect the Go standard
http.Handler
interface
Speed
- BenchmarkBoneMux 10000000 118 ns/op
- BenchmarkZeusMux 100000 144 ns/op
- BenchmarkHttpRouterMux 10000000 134 ns/op
- BenchmarkNetHttpMux 3000000 580 ns/op
- BenchmarkGorillaMux 300000 3333 ns/op
- BenchmarkGorillaPatMux 1000000 1889 ns/op
These tests are just for fun, all these routers are great and efficient. Bone isn't the fastest router for every job.
Example
package main
import(
"net/http"
"github.com/go-zoo/bone"
)
func main () {
mux := bone.New()
mux.RegisterValidatorFunc("isNum", func(s string) bool {
if _, err := strconv.Atoi(s); err == nil {
return true
}
return false
})
// mux.Get, Post, etc ... takes http.Handler
// validator for route parameter
mux.Get("/home/:id|isNum", http.HandlerFunc(HomeHandler))
// multiple parameter
mux.Get("/profil/:id/:var", http.HandlerFunc(ProfilHandler))
mux.Post("/data", http.HandlerFunc(DataHandler))
// Support REGEX Route params
mux.Get("/index/#id^[0-9]$", http.HandlerFunc(IndexHandler))
// Handle take http.Handler
mux.Handle("/", http.HandlerFunc(RootHandler))
// GetFunc, PostFunc etc ... takes http.HandlerFunc
mux.GetFunc("/test", Handler)
http.ListenAndServe(":8080", mux)
}
func Handler(rw http.ResponseWriter, req *http.Request) {
// Get the value of the "id" parameters.
val := bone.GetValue(req, "id")
rw.Write([]byte(val))
}
Blog Posts
- http://www.peterbe.com/plog/my-favorite-go-multiplexer
- https://harshladha.xyz/my-first-library-in-go-language-hasty-791b8e2b9e69
Libs
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].