A batteries-included web framework built on the Rivaas router with integrated observability, lifecycle management, and sensible defaults for building production-ready applications.
📖 Full Documentation | 🔧 Installation | 📘 User Guide | 📑 API Reference | 💡 Examples | 🐛 Troubleshooting
- Batteries-Included - Pre-configured with sensible defaults for rapid development
- Integrated Observability - Built-in metrics (Prometheus/OTLP), tracing (OpenTelemetry), and structured logging (slog)
- Request Binding & Validation – Automatic request parsing with comprehensive validation strategies
- OpenAPI Generation – Automatic OpenAPI spec generation with Swagger UI
- Lifecycle Hooks - OnStart, OnReady, OnShutdown, OnStop for initialization and cleanup
- Health Endpoints - Kubernetes-compatible liveness and readiness probes
- Graceful Shutdown – Proper server shutdown with configurable timeouts
- Environment-Aware - Development and production modes with appropriate defaults
go get rivaas.dev/appRequires Go 1.25+
package main
import (
"context"
"log"
"net/http"
"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 App!",
})
})
if err := a.Start(context.Background()); err != nil {
log.Fatal(err)
}
}For HTTPS or mTLS, configure at construction with WithTLS or WithMTLS, then call Start(ctx). The default port is 8080 for HTTP and 8443 for TLS/mTLS (override with WithPort).
Custom tracing: In handlers use c.SetSpanAttribute, c.AddSpanEvent, and for child spans c.StartSpan("name") with defer c.FinishSpan(span, statusCode). Use c.Tracer() only for advanced use (e.g., passing the tracer to another library). Request spans support W3C propagation and sampling.
Custom metrics: Use c.IncrementCounter, c.AddCounter, c.RecordHistogram, and c.SetGauge on app.Context.
- Installation Guide – Set up the app package
- Basic Usage – Learn the fundamentals
- Configuration - Configure your application
- Observability – Integrate metrics, tracing, and logging
- Context - Request binding and validation
- Lifecycle – Use lifecycle hooks
- Health Endpoints – Configure health checks
- Examples – Complete working examples
- Migration Guide – Migrate from router package
See pkg.go.dev/rivaas.dev/app for complete API documentation.
Contributions are welcome! Please see the main repository for contribution guidelines.
Apache License 2.0 – see LICENSE for details.
Part of the Rivaas web framework ecosystem.