Popularity
7.9
Growing
Activity
0.0
Stable
1,271
36
84
Programming language: Go
License: MIT License
Tags:
Web Frameworks
Latest version: v1.3.0
Bone alternatives and similar packages
Based on the "Web Frameworks" category.
Alternatively, view Bone alternatives based on common mentions on social networks and blogs.
-
Gin
Gin is a web framework written in Go! It features a martini-like API with much better performance, up to 40 times faster. If you need performance and good productivity. -
go-kit
A Microservice toolkit with support for service discovery, load balancing, pluggable transports, request tracking, etc. -
Iris
High-performance golang web application framework, providing a robust set of features for building modern web applications. -
httprouter
A high performance router. Use this and the standard http handlers to form a very high performance web framework. -
Faygo
Faygo uses the new architecture to make itself the most suitable Go Web framework for developping API. Just define a struct Handler, Faygo will automatically bind, verify the request parameters and generate the online API documentation. -
REST Layer
A framework to build REST/GraphQL API on top of databases with mostly configuration over code. -
Goyave
Feature-complete web framework aimed at clean code and fast development, with powerful built-in functionalities. -
rye
Tiny Go middleware library (with canned Middlewares) that supports JWT, CORS, Statsd, and Go 1.7 context -
ozzo-routing
A high-performance HTTP router and Web framework supporting routes with regular expressions. Comes with full support for quickly building a RESTful API application.
Get performance insights in less than 4 minutes
Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Sponsored
scoutapm.com
Do you think we are missing an alternative of Bone or a related project?
Popular Comparisons
README
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