go-relax alternatives and similar packages
Based on the "Web Frameworks" category.
Alternatively, view go-relax 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
DISCONTINUED. A fast, well-tested and widely used WebSocket implementation for Go. -
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: -
GoFrame
GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang. -
goa
๐ Goa: Elevate Go API development! ๐ Streamlined design, automatic code generation, and seamless HTTP/gRPC support. โจ -
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. -
Huma
A modern, simple, fast & flexible micro framework for building HTTP REST/RPC APIs in Go backed by OpenAPI 3 and JSON Schema. -
GoFr
An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability. -
go-server-timing
DISCONTINUED. Go (golang) library for creating and consuming HTTP Server-Timing headers
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of go-relax or a related project?
README
Go-Relax
Build fast and complete RESTful APIs in Go
Go-Relax aims to provide the tools to help developers build RESTful web services, and information needed to abide by REST architectural constraints using correct HTTP semantics.
Quick Start
Install using "go get":
go get github.com/codehack/go-relax
Then import from your source:
import "github.com/codehack/go-relax"
View example_test.go for an extended example of basic usage and features.
Also, check the wiki for HowTo's and recipes.
Features
- Helps build API's that follow the REST concept using ROA principles.
- Built-in support of HATEOAS constraint with Web Linking header tags.
- Follows REST "best practices", with inspiration from Heroku and GitHub.
- Works fine along with
http.ServeMux
or independently ashttp.Handler
- Supports different media types, and mixed for requests and responses.
- It uses JSON media type by default, but also includes XML (needs import).
- The default routing engine uses trie with regexp matching for speed and flexibility.
- Comes with a complete set of filters to build a working API. "Batteries included"
- Uses
sync.pool
to efficiently use resources when under heavy load.
Included filters
- [x] Content - handles mixed request/response encodings, language preference, and versioning.
- [x] Basic authentication - to protect any resource with passwords.
- [x] CORS - Cross-Origin Resource Sharing, for remote client-server setups.
- [x] ETag - entity tagging with conditional requests for efficient caching.
- [x] GZip - Dynamic gzip content data compression, with ETag support.
- [x] Logging - custom logging with pre- and post- request event support.
- [x] Method override - GET/POST method override via HTTP header and query string.
- [x] Security - Various security practices for request handling.
- [x] Limits - request throttler, token-based rate limiter, and memory limits.
Upcoming filters
- [ ] Relaxed - Test API's compliance with Relax API Specification (based on REST).
- [ ] JSON-API support.
- [ ] JSON-Schema for validating requests and responses.
- [ ] Collection-JSON support.
Documentation
The full code documentation is located at GoDoc:
http://godoc.org/github.com/codehack/go-relax
The source code is thoroughly commented, have a look.
Hello World
This minimal example creates a new Relax service that handles a Hello resource.
package main
import (
"github.com/codehack/go-relax"
)
type Hello string
func (h *Hello) Index(ctx *relax.Context) {
ctx.Respond(h)
}
func main() {
h := Hello("hello world!")
svc := relax.NewService("http://api.company.com/")
svc.Resource(&h)
svc.Run()
}
$ curl -i -X GET http://api.company.com/hello
Response:
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Link: </hello>; rel="self"
Link: </hello>; rel="index"
Request-Id: 61d430de-7bb6-4ff8-84da-aff6fe81c0d2
Server: Go-Relax/0.5.0
Date: Thu, 14 Aug 2014 06:20:48 GMT
Content-Length: 14
"hello world!"
Credits
Go-Relax is Copyright (c) Codehack. Published under an MIT License
*Note that all licence references and agreements mentioned in the go-relax README section above
are relevant to that project's source code only.