Goat alternatives and similar packages
Based on the "Web Frameworks" category.
Alternatively, view Goat 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. -
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 -
go-kratos
Your ultimate Go microservices framework for the cloud-native era. -
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 -
fasthttprouter
A high performance fasthttp request router that scales well -
Goji
Goji is a minimalistic and flexible HTTP request multiplexer for Go (golang) -
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 -
xujiajun/gorouter
xujiajun/gorouter is a simple and fast HTTP router for Go. It is easy to build RESTful APIs and your web framework. -
Beego
beego is an open-source, high-performance web framework for the Go programming language. -
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.
Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
Do you think we are missing an alternative of Goat or a related project?
Popular Comparisons
README
:warning: DEPRECATED :warning:
This project is no longer maintained, please use something like gorilla/mux or echo.
Goat

Goat is a minimalistic REST API server in Go. You can pronounce it like the goat, or go-at. Depends on how you like goats.
Contents
Usage
Parameters
You can use named parameters and access them through goat.Params
,
wich you can treat as any map[string]string
.
package main
import (
"net/http"
"github.com/bahlo/goat"
)
func helloHandler(w http.ResponseWriter, r *http.Request, p goat.Params) {
goat.WriteJSON(w, map[string]string{
"hello": p["name"],
})
}
func main() {
r := goat.New()
r.Get("/hello/:name", "hello_url", helloHandler)
r.Run(":8080")
}
Subrouters
You can create subrouters to simplify your code
func main() {
r := goat.New()
r.Get("/hello/:name", "hello_url", helloHandler)
sr := r.Subrouter("/user")
{
sr.Post("/login", "user_login_url", loginHandler)
sr.Get("/logout", "user_logout_url", logoutHandler)
}
r.Run(":8080")
}
Indices
Every route can have a description (like user_login_url
). These can be used
to automagically generate an API index (like this).
If you want to hide specific methods, just provide an empty string.
func main() {
r := goat.New()
r.Get("/", "", r.IndexHandler)
r.Get("/hello/:name", "hello_url", helloHandler)
sr := r.Subrouter("/user")
{
sr.Post("/login", "user_login_url", loginHandler)
sr.Get("/logout", "user_logout_url", logoutHandler)
}
r.Run(":8080")
}
The above example would return the following response on /
:
{
"hello_url": "/hello/:name",
"user_logout_url": "/user/logout"
}
Note: Indices are only supported for GET
requests. Open an issue, if you
want them on other methods, too
Middleware
You can easily include any middleware you like. A great guide to middleware is found here. Important is, that it's in the following format:
func(http.Handler) http.Handler
Example:
func main() {
r := goat.New()
r.Get("/hello/:name", "hello_url", helloHandler)
r.Use(loggerMiddleware, gzipMiddleware)
r.Run(":8080")
}
Wrapping middleware
Sometimes middleware isn't in the required format, so you have to build a
wrapper around it. This example shows a wrapper around
handlers.CombinedLoggingHandler
from the
Gorilla handlers:
func loggerMiddleware(h http.Handler) http.Handler {
// Create logfile (you should check for errors)
f, _ := os.Create("api.log")
return handlers.CombinedLoggingHandler(f, h)
}
You can now safely use the middleware in Goat:
func main() {
r := goat.New()
r.Get("/hello/:name", "hello_url", helloHandler)
r.Use(loggerMiddleware)
r.Run(":8080")
}
Philosophy
I wanted to create a small, fast and reliable REST API server, which supports quick JSON and error output, good rooting and easy-to-use middleware.
I have split the files after responsibility to make it easy for everyone to
dive in (start with goat.go
).
Feedback
If you have problems, feel free to create an issue or drop me an email at [email protected]!
Credits
Thanks to Julien Schmidt for the amazing httprouter used in this project.
License
This project is licensed unter MIT, for more information look into the LICENSE file.
*Note that all licence references and agreements mentioned in the Goat README section above
are relevant to that project's source code only.