Gearbox alternatives and similar packages
Based on the "Web Frameworks" category.
Alternatively, view Gearbox alternatives based on common mentions on social networks and blogs.
-
Gin
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin. -
go-kratos
Your ultimate Go microservices framework for the cloud-native era. -
Gorilla WebSocket
A fast, well-tested and widely used WebSocket implementation for Go. -
Iris
The fastest HTTP/2 Go Web Framework. A true successor of expressjs and laravel. Supports AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. Thank you / 谢谢 https://github.com/kataras/iris/issues/1329 -
mux
A powerful HTTP router and URL matcher for building Go web servers with 🦍 -
chi
lightweight, idiomatic and composable router for building Go HTTP services -
go-socket.io
socket.io library for golang, a realtime application framework. -
Macaron
Package macaron is a high productive and modular web framework in Go. -
Faygo
Faygo is a fast and concise Go Web framework that can be used to develop high-performance web app(especially API) with fewer codes. Just define a struct handler, faygo will automatically bind/verify the request parameters and generate the online API doc. -
render
Go package for easily rendering JSON, XML, binary data, and HTML templates responses. -
pat
Sinatra style pattern muxer for Go’s net/http library, by the author of Sinatra. -
tigertonic
A Go framework for building JSON web services inspired by Dropwizard -
Goji
Goji is a minimalistic and flexible HTTP request multiplexer for Go (golang) -
fasthttprouter
A high performance fasthttp request router that scales well -
go-server-timing
Go (golang) library for creating and consuming HTTP Server-Timing headers -
Beego
beego is an open-source, high-performance web framework for the Go programming language. -
xujiajun/gorouter
xujiajun/gorouter is a simple and fast HTTP router for Go. It is easy to build RESTful APIs and your web framework. -
golongpoll
golang long polling library. Makes web pub-sub easy via HTTP long-poll servers and clients :smiley: :coffee: :computer: -
traffic
Sinatra inspired regexp/pattern mux and web framework for Go [NOT MAINTAINED] -
ozzo-routing
An extremely fast Go (golang) HTTP router that supports regular expression route matching. Comes with full support for building RESTful APIs.
Less time debugging, more time building
Do you think we are missing an alternative of Gearbox or a related project?
Popular Comparisons
README
gearbox :gear: is a web framework for building micro services written in Go with a focus on high performance. It's built on fasthttp which is up to 10x faster than net/http
gearbox seeks to be
- Secure :closed_lock_with_key:
- Fast :rocket:
- Easy to use :eyeglasses:
- Lightweight
Supported Go versions & installation
:gear: gearbox requires version 1.14
or higher of Go (Download Go)
Just use go get to download and install gearbox
go get -u github.com/gogearbox/gearbox
Examples
package main
import (
"github.com/gogearbox/gearbox"
)
func main() {
// Setup gearbox
gb := gearbox.New()
// Define your handlers
gb.Get("/hello", func(ctx gearbox.Context) {
ctx.SendString("Hello World!")
})
// Start service
gb.Start(":3000")
}
Parameters
package main
import (
"github.com/gogearbox/gearbox"
)
func main() {
// Setup gearbox
gb := gearbox.New()
// Handler with parameter
gb.Get("/users/:user", func(ctx gearbox.Context) {
ctx.SendString(ctx.Param("user"))
})
// Start service
gb.Start(":3000")
}
Middlewares
package main
import (
"log"
"github.com/gogearbox/gearbox"
)
func main() {
// Setup gearbox
gb := gearbox.New()
// create a logger middleware
logMiddleware := func(ctx gearbox.Context) {
log.Printf("log message!")
// Next is what allows the request to continue to the next
// middleware/handler
ctx.Next()
}
// create an unauthorized middleware
unAuthorizedMiddleware := func(ctx gearbox.Context) {
ctx.Status(gearbox.StatusUnauthorized)
.SendString("You are unauthorized to access this page!")
}
// Register the log middleware for all requests
gb.Use(logMiddleware)
// Define your handlers
gb.Get("/hello", func(ctx gearbox.Context) {
ctx.SendString("Hello World!")
})
// Register the routes to be used when grouping routes
routes := []*gearbox.Route{
gb.Get("/id", func(ctx gearbox.Context) {
ctx.SendString("User X")
}),
gb.Delete("/id", func(ctx gearbox.Context) {
ctx.SendString("Deleted")
}),
}
// Group account routes
accountRoutes := gb.Group("/account", routes)
// Group account routes to be under api
gb.Group("/api", accountRoutes)
// Define a route with unAuthorizedMiddleware as the middleware
// you can define as many middlewares as you want and have
// the handler as the last argument
gb.Get("/protected", unAuthorizedMiddleware, func(ctx gearbox.Context) {
ctx.SendString("You accessed a protected page")
})
// Start service
gb.Start(":3000")
}
Static Files
package main
import (
"github.com/gogearbox/gearbox"
)
func main() {
// Setup gearbox
gb := gearbox.New()
// Serve files in assets directory for prefix static
// for example /static/gearbox.png, etc.
gb.Static("/static", "./assets")
// Start service
gb.Start(":3000")
}
Benchmarks
- CPU 3.1 GHz Intel Xeon® Platinum 8175M (24 physical cores, 48 logical cores)
- MEMORY 192GB
- GO go 1.14.6 linux/amd64
- OS Linux
For more results, check Our Docs
Contribute & Support
- Add a GitHub Star
- Suggest new features, ideas and optimizations
- Report issues
- Donating a cup of coffee
Check Our Docs for more information about gearbox and how to contribute
Sponsors
Organizations that are helping to manage, promote, and support Gearbox :gear:
trella: A B2B technology platform and trucking marketplace that connects shippers with carriers |
Who uses Gearbox
Gearbox :gear: is being used by multiple organizations including but not limited to
Contributors
Get in touch!
Feel free to chat with us on Discord, or email us at [[email protected]]([email protected]) if you have questions, or suggestions
License
gearbox is licensed under [MIT License](LICENSE)
Logo is created by Mahmoud Sayed and distributed under Creative Commons License
Third-party library licenses
*Note that all licence references and agreements mentioned in the Gearbox README section above
are relevant to that project's source code only.