Rivaas Core Framework

website·Indexed 32 days ago

https://rivaas.dev/docs

A Go web framework designed for REST APIs, microservices, and cloud-native applications. Rivaas provides a batteries-included application framework and HTTP router featuring integrated observability (OpenTelemetry), automatic OpenAPI specification generation, type-safe request data binding, multi-strategy validation, and structured logging using log/slog.

Tokens
390.6K
Snippets
2.4K
Records
2.6K
Agent score
61%

What's inside Rivaas

  1. Overview of Metrics Providers

    The metrics package supports three provider types for exporting metrics. Only one provider can be used per Recorder instance; attempting to use multiple provider options will result in a validation error.
  2. Overview of Rivaas HTTP Router

    The Rivaas Router is a high-performance, production-ready HTTP router for Go, designed for cloud-native applications. It features sub-microsecond routing, zero-allocation parameter extraction (for up to 8 parameters), and lock-free concurrent operations. Key technical capabilities include Radix tree routing with bloom filters for static lookups, optional pre-compiled route tables for large APIs, and integrated support for OpenTelemetry.
  3. Overview of Application Lifecycle Hooks

    The app package provides several lifecycle hooks to manage application state. All hooks must be registered before calling Start(); attempting to register a hook after the router is frozen will return an error.

    • OnStart: Runs sequentially before the server starts. Stops on the first error.
    • OnReady: Runs asynchronously after the server is ready to accept connections. Non-blocking.
    • OnReload: Runs sequentially when a SIGHUP signal is received or Reload() is called. Errors are logged.
    • OnShutdown: Runs during graceful shutdown in LIFO (Last In, First Out) order.
    • OnStop: Runs after shutdown completes (best-effort).
    • OnRoute: Synchronous hook called when a route is registered.
  4. Overview of the Rivaas Go web framework

    Rivaas is a web framework for Go designed to simplify the creation of web APIs. It is built to be production-ready, lightweight (low memory usage), flexible across environments, and modular, with each package designed to stand alone so developers only use what they need.
  5. Overview of Rivaas Middleware

    Middleware functions in Rivaas intercept HTTP requests to add cross-cutting functionality such as logging, authentication, and error recovery. They wrap route handlers, executing code both before and after the core handler logic in a layered approach: Request → Middleware 1 → Middleware 2 → Handler → Middleware 2 → Middleware 1 → Response.
  6. Overview of the rivaas.dev/binding package

    The binding package allows developers to bind request data from various sources (query parameters, JSON bodies, headers, etc.) into Go structs using struct tags. It features a type-safe generic API, zero-allocation reflection caching, and support for multiple data formats including JSON, XML, YAML, TOML, MessagePack, and Protocol Buffers.
    import "rivaas.dev/binding"
    
    type CreateUserRequest struct {
        Username string `json:"username"` 
        Email    string `json:"email"` 
        Age      int    `json:"age"` 
    }
    
    // Generic API (preferred)
    user, err := binding.JSON[CreateUserRequest](body)
  7. Overview of Rivaas Binding

    The rivaas.dev/binding package provides high-performance request data binding. It maps values from query parameters, form data, JSON bodies, headers, cookies, and path parameters into Go structs using struct tags and a type-safe generic API.
    import "rivaas.dev/binding"
  8. Overview of Rivaas Config

    The rivaas.dev/config package provides configuration management for Go applications. It supports multiple sources (files, environment variables, remote sources), is format-agnostic (JSON, YAML, TOML), supports hierarchical merging, and provides automatic struct binding with validation.
    import "rivaas.dev/config"
  9. Overview of the Rivaas Application Framework

    The Rivaas App package is a complete web framework built on top of the Rivaas router. It is designed for rapid development of production-ready applications, offering a high-level API that includes integrated observability (metrics, tracing, and logging), lifecycle management (graceful shutdown), and common middleware patterns. It is particularly suited for REST APIs and cloud-native microservices.
  10. Overview of Rivaas Web Framework

    Rivaas is a high-performance, lightweight web framework for Go designed for creating web APIs. It prioritizes developer experience, production readiness, and independence, where each package is designed to work on its own without unnecessary dependencies.
  11. Overview of Rivaas Tracing

    The rivaas.dev/tracing package provides OpenTelemetry-based distributed tracing with support for Stdout, OTLP (gRPC and HTTP), and Noop providers. It includes HTTP middleware for request tracing, manual span management, and context propagation.
    import "rivaas.dev/tracing"
  12. Overview of Rivaas OpenAPI

    The rivaas.dev/openapi package automatically generates OpenAPI 3.0.4 and 3.1.2 specifications from Go code using struct tags and reflection. It features fluent HTTP method constructors, automatic parameter discovery, schema generation, and Swagger UI configuration.
    import "rivaas.dev/openapi"