Website | Documentation | Blog | Getting Started
A batteries-included, cloud-native web framework for Go featuring high-performance routing, comprehensive request binding and validation, automatic OpenAPI generation, and OpenTelemetry-native observability.
We run benchmarks on every router release. For the latest numbers and how we measure them, see Router Performance.
- Production-Ready — Graceful shutdown, health endpoints, panic recovery, mTLS
- High Performance — Radix tree router with Bloom filter optimization
- Flexible — Use
appfor batteries-included orrouterfor full control - Cloud-Native — OpenTelemetry-native with Prometheus, OTLP, Jaeger support
- Modular — Each package works standalone without the full framework
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"rivaas.dev/app"
)
func main() {
a, err := app.New()
if err != nil {
log.Fatal(err)
}
a.GET("/", func(c *app.Context) {
c.JSON(http.StatusOK, map[string]string{"message": "Hello from Rivaas!"})
})
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer cancel()
if err := a.Start(ctx); err != nil {
log.Fatal(err)
}
}For HTTPS or mTLS, use app.WithTLS or app.WithMTLS at construction, then Start(ctx). Default port is 8080 for HTTP and 8443 for TLS/mTLS (override with app.WithPort(n)).
With observability:
a, err := app.New(
app.WithServiceName("my-api"),
app.WithObservability(
app.WithLogging(logging.WithConsoleHandler()),
app.WithMetrics(), // Prometheus on :9090/metrics
app.WithTracing(tracing.WithStdout()),
),
)In handlers use c.StartSpan / c.FinishSpan for child spans and c.AddCounter, c.IncrementCounter, c.RecordHistogram, and c.SetGauge for custom metrics.
See full-featured example for a complete production setup.
go get rivaas.dev/appThe app module requires Go 1.27 or later. Binding method signatures are unchanged, but users on Go 1.25 or 1.26 must upgrade their toolchain to use rivaas.dev/app. Other modules in this repository still require Go 1.25 or later.
The name Rivaas comes from ریواس (Rivās) — a wild rhubarb plant native to the mountains of Iran.
This plant grows at high altitudes (1,500–3,000 meters) in harsh, rocky terrain where few other plants survive. It withstands extreme temperature swings, poor soil, and unpredictable weather — yet it thrives, providing food and medicine to mountain communities for centuries.
That's the philosophy behind Rivaas:
| Principle | Description |
|---|---|
| 🛡️ Resilient | Built for production with graceful shutdown, health checks, and panic recovery |
| ⚡ Lightweight | Minimal overhead without sacrificing features — see Performance for latest benchmarks |
| 🔧 Adaptive | Works locally, in containers, or across distributed systems with the same code |
| 📦 Self-sufficient | Integrated observability (metrics, tracing, logging) instead of bolted-on dependencies |
Like its namesake growing in the mountains, Rivaas is designed to thrive in dynamic, cloud-native environments — lightweight yet powerful, modular yet simple.
| Package | Description | Docs |
|---|---|---|
| app | Batteries-included web framework | |
| router | High-performance HTTP router |
| Package | Description | Docs |
|---|---|---|
| config | Configuration management (files, env vars, Consul, validation) |
| Package | Description | Docs |
|---|---|---|
| binding | Request binding (query, form, JSON, headers, XML, YAML, MsgPack, Proto) | |
| validation | Struct validation with tags and JSON Schema |
| Package | Description | Docs |
|---|---|---|
| logging | Structured logging with slog | |
| metrics | OpenTelemetry metrics (Prometheus, OTLP) | |
| tracing | Distributed tracing (OTLP, Jaeger, stdout) |
| Package | Description | Docs |
|---|---|---|
| openapi | Automatic OpenAPI 3.0/3.1 generation with Swagger UI | |
| errors | Error formatting (RFC 9457, JSON:API) |
┌─────────────────────────────────────────────────────────────┐
│ rivaas.dev/app │
│ Batteries-included framework │
├─────────────────────────────────────────────────────────────┤
│ rivaas.dev/router │
│ High-performance HTTP router │
├───────────────┬───────────────┬─────────────────────────────┤
│ logging │ metrics │ tracing │
│ binding │ validation │ openapi │
│ errors │ config │ │
└───────────────┴───────────────┴─────────────────────────────┘
Each package is independently usable with its own go.mod. The app package integrates them with automatic service metadata propagation and lifecycle management.
a, err := app.New(
app.WithServiceName("my-api"),
app.WithServiceVersion("v1.0.0"),
app.WithObservability(
app.WithLogging(logging.WithJSONHandler()),
app.WithMetrics(),
app.WithTracing(tracing.WithOTLP("localhost:4317")),
),
app.WithHealthEndpoints(
app.WithReadinessCheck("database", dbPingCheck),
),
)See App Documentation for complete configuration options.
Twelve production-ready middleware included: accesslog, recovery, cors, requestid, timeout, ratelimit, basicauth, bodylimit, compression, security, methodoverride, trailingslash.
| Directory | Description |
|---|---|
| App Examples | Quick start and full-featured apps |
| Router Examples | Routing, middleware, versioning, static files |
| Middleware Examples | Each package has an example/ subdirectory with runnable demos |
We benchmark the router on every release. For the latest numbers and comparisons with Gin, Echo, Chi, Fiber, and others, see Router Performance. To run the benchmarks yourself, see router/benchmarks.
Multi-module repository — each package has its own go.mod and can be versioned independently.
rivaas/
├── app/ → rivaas.dev/app
├── middleware/ → rivaas.dev/middleware/*
├── router/ → rivaas.dev/router
├── binding/ → rivaas.dev/binding
├── validation/ → rivaas.dev/validation
├── config/ → rivaas.dev/config
├── logging/ → rivaas.dev/logging
├── metrics/ → rivaas.dev/metrics
├── tracing/ → rivaas.dev/tracing
├── openapi/ → rivaas.dev/openapi
├── errors/ → rivaas.dev/errors
└── go.work → workspace configuration
| Resource | Description |
|---|---|
| App Guide | Complete framework documentation |
| Router Guide | HTTP routing and request handling |
| Config Guide | Configuration management |
| Middleware Catalog | All 12 middleware with examples |
| Design Principles | Architecture and design decisions |
| Testing Standards | Testing guidelines and patterns |
The repository is a set of independently versioned Go modules. Read CONTRIBUTING.md for the workflow: commits, pull requests, tests, dependencies, and releases. Titles look like router: add configurable timeout or contrib: update the workflow.
Nix helpers (nix run .#pr, nix run .#commit, nix run .#release) are optional. The same pull request template and the same CI checks apply when you use Git and GitHub directly.
Apache License 2.0 – see LICENSE for details.
Made with ❤️ for the Go community