Web framework for Go whose builder makes out-of-order setup a compile error
open sourceBSD-3-Clausefree
Iris is a batteries-included web framework for Go, developed in the open since 2016. Version 14 assembles an application through a chain of builder interfaces, each narrower than the last, so a step called out of order fails to compile. It has routing with 20 typed path parameter types and custom macros, a central map from Go errors to HTTP responses, dependency injection with startup and shutdown hooks, JSON binding that runs a type's own Validate method, and in-process test helpers. Server-Sent Events and AI streaming responses are handled by its sse and ai packages, and 31 middleware packages ship in the tree, from access logs, CORS, compression, JWT, sessions and rate limiting to i18n, gRPC and websockets. Its documentation is a free 444-page book, plus 78 runnable examples.
Problems it solves
- a full-featured web framework for building REST APIs in Go
- a Go web framework with dependency injection, validation and middleware included
- stream Server-Sent Events or AI model output from a Go server
Features
- Compile-time-checked application builder
- Typed path parameters and custom macros
- Central error-to-response mapping
- Dependency injection with lifecycle hooks
- Self-validating JSON binding
- Server-Sent Events and AI streaming
- 31 bundled middleware packages
- In-process test helpers
Limitations
- Version 14 needs Go 1.27 or newer1
Alternatives
The same job
These do what Iris does.
- Gin The fastest full-featured HTTP web framework for Go
- f.lux Software to make your life better: your screen adapts to the time of day
- Echo High performance, minimalist Go web framework
- Beego A full-stack MVC web framework for building REST APIs, web apps and backend services in Go
- GoFr Opinionated Go framework for microservices with built-in observability and Kubernetes focus
- go-zero A cloud-native Go microservices framework with a code generation CLI
