Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

App

Go Reference Go Report Card Coverage Go Version License

A batteries-included web framework built on the Rivaas router with integrated observability, lifecycle management, and sensible defaults for building production-ready applications.

📚 Documentation

📖 Full Documentation | 🔧 Installation | 📘 User Guide | 📑 API Reference | 💡 Examples | 🐛 Troubleshooting

Features

  • 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

Installation

go get rivaas.dev/app

Requires Go 1.25+

Quick Start

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.

Learn More

API Reference

See pkg.go.dev/rivaas.dev/app for complete API documentation.

Contributing

Contributions are welcome! Please see the main repository for contribution guidelines.

License

Apache License 2.0 – see LICENSE for details.


Part of the Rivaas web framework ecosystem.