stratus

package module
v0.0.0-...-4d267ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 7 Imported by: 0

README

Stratus

Stratus is a minimal, secure-by-default Go web framework for building APIs—designed for production teams that care about validation, audit-ready security logging, and first-class observability (traces/metrics/log correlation).


✨ Key Features

🛡️ Middleware-First Pipeline

The request lifecycle is managed through a robust, order-dependent pipeline:

  • Security Headers: Built-in protection for HSTS, CSP, and XSS.
  • Access Control: Integrated authentication and rate limiting.
  • Custom Hooks: Easily inject logic before or after request execution.
✅ Request Validation

Achieve consistency across your API with automated validation:

  • Deep Inspection: Validates request bodies, query parameters, and headers.
  • Standardized Errors: Ensures every validation failure returns a consistent JSON schema to the client.
📝 Security & Audit Logging

Built for compliance and forensics, Stratus captures granular event data:

  • Request ID: A unique identifier for every transaction.
  • Actor Attribution: Automatically tracks the user or service account responsible.
  • Outcome & Reason: Explicit logging of why a request was successful or blocked.
🔭 First-Class Observability

Designed for distributed systems and modern monitoring stacks:

  • Trace Correlation: Automatic propagation of Trace IDs across logs and metrics.
  • Vendor Agnostic: Integrated hooks for OpenTelemetry, New Relic, and more.
  • Audit Events: Context-rich logging for deep-dive debugging.

📊 Observability Matrix

Component Description
Request ID Tracks the lifecycle of a single incoming call.
Actor Identifies the identity/service making the request.
Outcome Logs the final status (Allow/Deny/Fail).
**

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	ServeHTTP(http.ResponseWriter, *http.Request)
}

type Router

type Router interface {
	HandleFunc(string, func(http.ResponseWriter, *http.Request))
}

type Stratus

func NewStratus

func NewStratus() *Stratus

func (*Stratus) Get

func (s *Stratus) Get(path string, handler func(http.ResponseWriter, *http.Request))

func (*Stratus) Start

func (s *Stratus) Start()

func (*Stratus) StratusRouter

func (s *Stratus) StratusRouter() StratusInterface

func (*Stratus) Use

func (s *Stratus) Use(m types.MiddleWare)

type StratusInterface

type StratusInterface interface {
	Router
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL