All Projects → gogearbox → Gearbox

gogearbox / Gearbox

Licence: mit
Gearbox ⚙️ is a web framework written in Go with a focus on high performance

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Gearbox

Foxify
The fast, easy to use & typescript ready web framework for Node.js
Stars: ✭ 138 (-69.67%)
Mutual labels:  api, framework, router, performance
Tenso
Tenso is an HTTP REST API framework
Stars: ✭ 167 (-63.3%)
Mutual labels:  api, rest, microservice
Diet
A tiny, fast and modular node.js web framework. Good for making fast & scalable apps and apis.
Stars: ✭ 394 (-13.41%)
Mutual labels:  api, rest, router
Typescript Rest
This is a lightweight annotation-based expressjs extension for typescript.
Stars: ✭ 458 (+0.66%)
Mutual labels:  api, rest, microservice
Appkernel
API development made easy: a smart Python 3 API framework
Stars: ✭ 152 (-66.59%)
Mutual labels:  api, rest, microservice
Fastapi Crudrouter
A dynamic FastAPI router that automatically creates CRUD routes for your models
Stars: ✭ 159 (-65.05%)
Mutual labels:  api, rest, framework
Component
🔥🔥🔥A powerful componentized framework.一个强大、100% 兼容、支持 AndroidX、支持 Kotlin并且灵活的组件化框架
Stars: ✭ 2,434 (+434.95%)
Mutual labels:  api, framework, router
Psx
PHP REST API Framework
Stars: ✭ 108 (-76.26%)
Mutual labels:  api, rest, framework
Ray
a framework that helps you to deliver well-designed python APIs
Stars: ✭ 215 (-52.75%)
Mutual labels:  api, rest, framework
Go Grpc Http Rest Microservice Tutorial
Source code for tutorial "How to develop Go gRPC microservice with HTTP/REST endpoint, middleware, Kubernetes deployment, etc."
Stars: ✭ 250 (-45.05%)
Mutual labels:  api, rest, microservice
Horse
Fast, opinionated, minimalist web framework for Delphi
Stars: ✭ 295 (-35.16%)
Mutual labels:  api, rest, framework
Pure Http
✨ The simple web framework for Node.js with zero dependencies.
Stars: ✭ 139 (-69.45%)
Mutual labels:  api, framework, router
Iris
The fastest HTTP/2 Go Web Framework. AWS Lambda, gRPC, MVC, Unique Router, Websockets, Sessions, Test suite, Dependency Injection and more. A true successor of expressjs and laravel | 谢谢 https://github.com/kataras/iris/issues/1329 |
Stars: ✭ 21,587 (+4644.4%)
Mutual labels:  framework, router, performance
Mono
Minimalist Framework on top of Express.js
Stars: ✭ 163 (-64.18%)
Mutual labels:  api, rest, framework
Narration
The Narration PHP Framework - Empowering everyone to build reliable and loosely coupled web apps.
Stars: ✭ 119 (-73.85%)
Mutual labels:  api, rest, framework
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-60.88%)
Mutual labels:  api, rest, microservice
Dreamfactory
DreamFactory API Management Platform
Stars: ✭ 1,148 (+152.31%)
Mutual labels:  api, rest, framework
Foal
Elegant and all-inclusive Node.Js web framework based on TypeScript. 🚀.
Stars: ✭ 1,176 (+158.46%)
Mutual labels:  api, rest, framework
Magic
Create your .Net Core/Angular/Database CRUD Web apps by simply clicking a button
Stars: ✭ 214 (-52.97%)
Mutual labels:  api, rest, framework
Kanary
A minimalist web framework for building REST APIs in Kotlin/Java.
Stars: ✭ 319 (-29.89%)
Mutual labels:  api, rest, microservice


DeepSource

gearbox ⚙️ 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 🔐
  • Fast 🚀
  • Easy to use 👓
  • Lightweight

Supported Go versions & installation

⚙️ 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

Check Our Docs for more information about gearbox and how to contribute

Sponsors

Organizations that are helping to manage, promote, and support Gearbox ⚙️

trella: A B2B technology platform and trucking
marketplace that connects shippers with carriers

Who uses Gearbox

Gearbox ⚙️ 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] if you have questions, or suggestions

License

gearbox is licensed under MIT License

Logo is created by Mahmoud Sayed and distributed under Creative Commons License

Third-party library licenses

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].