Lean Go package for building REST-style web services
open sourceMITfree
go-restful is a Go package for building REST-style web services: routes map requests to functions with path parameters, request and response APIs read and write structs as JSON or XML, and filters intercept requests at service or route level. It adds containers for services on different endpoints, gzip and deflate encoding, automatic OPTIONS and CORS handling, panic recovery, configurable errors and logging, and OpenAPI/Swagger declarations through go-restful-openapi. It's by Ernest Micklei.
Problems it solves
- build a REST API in Go without a heavy framework
- document a Go REST service with Swagger
- add CORS and gzip to a Go web service
Features
- routes with path parameters and configurable routers
- JSON/XML request and response APIs
- filters at service and route level
- gzip/deflate, OPTIONS and CORS handling
- OpenAPI via go-restful-openapi
Alternatives
The same job
These do what go-restful does.
- Echo High performance, minimalist Go web framework
- chi Lightweight, composable HTTP router for Go services built on net/http
- Gin The fastest full-featured HTTP web framework for Go
- GoFr Opinionated Go framework for microservices with built-in observability and Kubernetes focus
- Iris Web framework for Go whose builder makes out-of-order setup a compile error
- Beego A full-stack MVC web framework for building REST APIs, web apps and backend services in Go
