Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. REST
  3. go-restful

go-restful

MITGov3.13.0

A Go package for building RESTful web services with explicit HTTP method mapping and flexible routing.

GitHubGitHub
5.1k stars681 forks0 contributors

What is go-restful?

go-restful is a Go package for building REST-style web services that explicitly map CRUD operations to HTTP methods. It provides tools for routing, request/response handling, and middleware to create scalable APIs. The package helps developers adhere to REST principles while offering flexibility through configurable routers and filters.

Target Audience

Go developers building RESTful APIs who need a lightweight, structured framework with explicit HTTP method mapping and extensible middleware.

Value Proposition

Developers choose go-restful for its simplicity, adherence to REST semantics, and rich feature set including flexible routing, built-in content encoding, and Swagger integration, all within a minimalistic Go-native design.

Overview

package for building REST-style Web Services using Go

Use Cases

Best For

  • Building RESTful APIs in Go with strict HTTP method semantics
  • Creating web services that require flexible URL routing with parameters and custom verbs
  • Developing APIs that need automatic CORS handling and OPTIONS responses
  • Implementing middleware and filters for cross-cutting concerns like logging or authentication
  • Integrating Swagger UI for API documentation
  • Handling JSON/XML payloads with built-in compression support

Not Ideal For

  • Projects requiring GraphQL, gRPC, or other non-REST API protocols
  • Teams needing a full-stack framework with built-in templating and front-end capabilities
  • Applications with complex real-time communication needs like WebSockets

Pros & Cons

Pros

Strict REST Semantics

Explicitly maps CRUD operations to HTTP methods, ensuring API consistency with protocol definitions as outlined in the README's philosophy section.

Configurable Routing

Offers both fast routing and JSR311-compliant algorithms, supporting path parameters, prefixes, suffixes, and custom verbs for flexible URL design per the features list.

Built-in Middleware Filters

Provides filters for intercepting requests and responses, enabling easy implementation of cross-cutting concerns like automatic CORS, logging, and content encoding without external dependencies.

Swagger Integration

Supports API declaration for Swagger UI through the go-restful-openapi extension, simplifying documentation generation as mentioned in the key features.

Cons

Go Modules Dependency

Version v3 and above require Go modules, which can be a barrier for legacy projects or teams not using module-based dependency management, as noted in the README's usage section.

Limited Protocol Scope

Focused solely on REST, it lacks built-in features for modern protocols like WebSockets or GraphQL, restricting its use to traditional HTTP-based APIs without additional integrations.

Verbose Configuration

Defining routes and services involves more boilerplate code compared to frameworks with more concise DSLs, as seen in the example where each route requires explicit parameter and method mappings.

Frequently Asked Questions

Quick Stats

Stars5,115
Forks681
Contributors0
Open Issues1
Last commit18 days ago
CreatedSince 2012

Tags

#http-server#rest#web-services#api-framework#rest-api#swagger#customizable#openapi#xml#json#go#middleware#routing

Built With

G
Go

Included in

REST3.9k
Auto-fetched 6 hours ago

Related Projects

go-json-restgo-json-rest

A quick and easy way to setup a RESTful JSON API

Stars3,487
Forks372
Last commit5 years ago
sleepysleepy

rest for go

Stars669
Forks52
Last commit8 years ago
gocrudgocrud

Go framework to simplify CRUD of structured data using Graph operations

Stars307
Forks23
Last commit7 years ago
go-relaxgo-relax

Framework for building RESTful API's in Go

Stars154
Forks9
Last commit5 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub