Siesta alternatives and similar packages
Based on the "Web Frameworks" category.
Alternatively, view Siesta 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. -
Iris
The fastest HTTP/2 Go Web Framework. New, modern, easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio :leaves: :rocket: | 谢谢 | #golang -
Gorilla WebSocket
A fast, well-tested and widely used WebSocket implementation for Go. -
go-kratos
Your ultimate Go microservices framework for the cloud-native era. -
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. -
Hertz
Go HTTP framework with high-performance and strong-extensibility for building micro-services. -
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 -
fasthttprouter
A high performance fasthttp request router that scales well -
Goji
Goji is a minimalistic and flexible HTTP request multiplexer for Go (golang) -
Atreugo
High performance and extensible micro web framework. Zero memory allocations in hot paths. -
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.
Static code analysis for 29 languages.
Do you think we are missing an alternative of Siesta or a related project?
Popular Comparisons
README
siesta
Siesta is a framework for writing composable HTTP handlers in Go. It supports typed URL parameters, middleware chains, and context passing.
Getting started
Siesta offers a Service
type, which is a collection of middleware chains and handlers rooted at a base URI. There is no distinction between a middleware function and a handler function; they are all considered to be handlers and have access to the same arguments.
Siesta accepts many types of handlers. Refer to the GoDoc documentation for Service.Route
for more information.
Here is the simple
program in the examples directory. It demonstrates the use of a Service
, routing, middleware, and a Context
.
package main
import (
"fmt"
"log"
"net/http"
"time"
"github.com/VividCortex/siesta"
)
func main() {
// Create a new Service rooted at "/"
service := siesta.NewService("/")
// Route accepts normal http.Handlers.
// The arguments are the method, path, description,
// and the handler.
service.Route("GET", "/", "Sends 'Hello, world!'",
func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello, world!")
})
// Let's create some simple "middleware."
// This handler will accept a Context argument and will add the current
// time to it.
timestamper := func(c siesta.Context, w http.ResponseWriter, r *http.Request) {
c.Set("start", time.Now())
}
// This is the handler that will actually send data back to the client.
// It also takes a Context argument so it can get the timestamp from the
// previous handler.
timeHandler := func(c siesta.Context, w http.ResponseWriter, r *http.Request) {
start := c.Get("start").(time.Time)
delta := time.Now().Sub(start)
fmt.Fprintf(w, "That took %v.\n", delta)
}
// We can compose these handlers together.
timeHandlers := siesta.Compose(timestamper, timeHandler)
// Finally, we'll add the new handler we created using composition to a new route.
service.Route("GET", "/time", "Sends how long it took to send a message", timeHandlers)
// service is an http.Handler, so we can pass it directly to ListenAndServe.
log.Fatal(http.ListenAndServe(":8080", service))
}
Siesta also provides utilities to manage URL parameters similar to the flag package. Refer to the params
example for a demonstration.
Contributing
We only accept pull requests for minor fixes or improvements. This includes:
- Small bug fixes
- Typos
- Documentation or comments
Please open issues to discuss new features. Pull requests for new features will be rejected, so we recommend forking the repository and making changes in your fork for your use case.
License
Siesta is licensed under the MIT license. The router, which is adapted from httprouter, is licensed separately.
*Note that all licence references and agreements mentioned in the Siesta README section above
are relevant to that project's source code only.