web.go alternatives and similar packages
Based on the "Web Frameworks" category.
Alternatively, view web.go 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. -
Iris
The fastest HTTP/2 Go Web Framework. New, modern and easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio :rocket: -
Gorilla WebSocket
A fast, well-tested and widely used WebSocket implementation for Go. -
chi
lightweight, idiomatic and composable router for building Go HTTP services -
GoFrame
GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang. -
go-socket.io
socket.io library for golang, a realtime application framework. -
Hertz
Go HTTP framework with high-performance and strong-extensibility for building micro-services. -
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 -
Atreugo
High performance and extensible micro web framework. Zero memory allocations in hot paths. -
Goji
Goji is a minimalistic and flexible HTTP request multiplexer for Go (golang) -
fasthttprouter
A high performance fasthttp request router that scales well -
Beego
beego is an open-source, high-performance web framework for the Go programming language. -
go-server-timing
Go (golang) library for creating and consuming HTTP Server-Timing headers -
Gearbox
Gearbox :gear: is a web framework written in Go with a focus on high performance -
golongpoll
golang long polling library. Makes web pub-sub easy via HTTP long-poll servers and clients :smiley: :coffee: :computer: -
xujiajun/gorouter
xujiajun/gorouter is a simple and fast HTTP router for Go. It is easy to build RESTful APIs and your web framework.
Updating dependencies is time-consuming.
Do you think we are missing an alternative of web.go or a related project?
Popular Comparisons
README
web.go
web.go is the simplest way to write web applications in the Go programming language. It's ideal for writing simple, performant backend web services.
Overview
web.go should be familiar to people who've developed websites with higher-level web frameworks like sinatra or web.py. It is designed to be a lightweight web framework that doesn't impose any scaffolding on the user. Some features include:
- Routing to url handlers based on regular expressions
- Secure cookies
- Support for fastcgi and scgi
- Web applications are compiled to native code. This means very fast execution and page render speed
- Efficiently serving static files
Installation
Make sure you have the a working Go environment. See the install instructions. web.go targets the Go release
branch.
To install web.go, simply run:
go get github.com/hoisie/web
To compile it from source:
git clone git://github.com/hoisie/web.git
cd web && go build
Example
package main
import (
"github.com/hoisie/web"
)
func hello(val string) string { return "hello " + val }
func main() {
web.Get("/(.*)", hello)
web.Run("0.0.0.0:9999")
}
To run the application, put the code in a file called hello.go and run:
go run hello.go
You can point your browser to http://localhost:9999/world .
Getting parameters
Route handlers may contain a pointer to web.Context as their first parameter. This variable serves many purposes -- it contains information about the request, and it provides methods to control the http connection. For instance, to iterate over the web parameters, either from the URL of a GET request, or the form data of a POST request, you can access ctx.Params
, which is a map[string]string
:
package main
import (
"github.com/hoisie/web"
)
func hello(ctx *web.Context, val string) {
for k,v := range ctx.Params {
println(k, v)
}
}
func main() {
web.Get("/(.*)", hello)
web.Run("0.0.0.0:9999")
}
In this example, if you visit http://localhost:9999/?a=1&b=2
, you'll see the following printed out in the terminal:
a 1
b 2
Documentation
API docs are hosted at https://hoisie.github.io/web/
If you use web.go, I'd greatly appreciate a quick message about what you're building with it. This will help me get a sense of usage patterns, and helps me focus development efforts on features that people will actually use.
About
web.go was written by Michael Hoisie