talira

go-restful

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.

  1. Echo High performance, minimalist Go web framework
  2. chi Lightweight, composable HTTP router for Go services built on net/http
  3. Gin The fastest full-featured HTTP web framework for Go
  4. GoFr Opinionated Go framework for microservices with built-in observability and Kubernetes focus
  5. Iris Web framework for Go whose builder makes out-of-order setup a compile error
  6. Beego A full-stack MVC web framework for building REST APIs, web apps and backend services in Go

Compare go-restful with the top 3