advanced-lokstra-middleware

Community

Advanced Lokstra middleware for secure routing.

Authorprimadi
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Create custom middleware to filter requests and responses, centralize logging, authentication, authorization, and other cross-cutting concerns after the framework is initialized.

Core Features & Use Cases

  • Standard middleware pattern with a Config struct, DefaultConfig, Middleware, MiddlewareFactory, and Register functions, enabling reusable, testable cross-cutting logic.
  • YAML-configurable middlewares that can be composed globally or per-route, including built-in examples like recovery, logging, CORS, rate-limiting, and request-id patterns.
  • Safe integration with lokstra_registry and a request.Context, allowing post-processing hooks and pre-processing decisions without mutating core flow.

Quick Start

  1. Create a new middleware package under middleware/your_middleware with Config, DefaultConfig, Middleware, MiddlewareFactory, and Register.
  2. In your application's bootstrap, call the Register function and invoke your middleware via router.Use(...) or per-route decorators.
  3. Configure via YAML under configs/middlewares.yaml to enable/adjust behavior across the app.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: advanced-lokstra-middleware
Download link: https://github.com/primadi/lokstra/archive/main.zip#advanced-lokstra-middleware

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.