Repository for third-party middleware and plugin implementations for the Mono Framework.
This repository contains community-contributed middleware modules, plugins, and integrations for the Mono Framework. Each package is designed to extend the functionality of Mono applications with minimal configuration.
Go version support: We support the latest two versions of Go. Visit https://go.dev/doc/devel/release for more information.
| Middleware | Description | Documentation |
|---|---|---|
| jwt | JWT authentication with multi-strategy support (HMAC, RSA, ECDSA, JWKS) | README |
| otel | OpenTelemetry instrumentation (metrics, traces, logs) | README |
Each middleware can be installed independently:
# JWT Middleware
go get github.com/go-monolith/contrib/v1/jwt
# OTEL Middleware
go get github.com/go-monolith/contrib/v1/otelpackage main
import (
"context"
"log"
"github.com/go-monolith/mono"
"github.com/go-monolith/contrib/v1/otel"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
)
func main() {
// Create OTEL provider
meterProvider := sdkmetric.NewMeterProvider(/* ... */)
// Create middleware
otelMw, err := otel.New(
otel.WithMeterProvider(meterProvider),
)
if err != nil {
log.Fatal(err)
}
// Create Mono application
app, err := mono.NewMonoApplication()
if err != nil {
log.Fatal(err)
}
// Register middleware BEFORE other modules
app.Register(otelMw)
app.Register(&MyModule{})
// Start
app.Start(context.Background())
}We welcome contributions! Please see our Contributing Guide for details on how to submit pull requests, report issues, and contribute to the project.
- Create a new directory under
v1/(e.g.,v1/my-middleware/) - Implement the
mono.MiddlewareModuleinterface - Add comprehensive tests
- Create a README.md with documentation
- Update this README.md to list your middleware
- Submit a pull request
contrib/
├── v1/ # Version 1 middleware implementations
│ ├── jwt/ # JWT authentication middleware
│ │ ├── README.md
│ │ ├── go.mod
│ │ ├── jwt.go
│ │ ├── config.go
│ │ ├── options.go
│ │ ├── validator.go
│ │ ├── jwks.go
│ │ ├── provider.go
│ │ └── *_test.go
│ └── otel/ # OpenTelemetry middleware
│ ├── README.md
│ ├── go.mod
│ ├── otel.go
│ ├── config.go
│ ├── options.go
│ ├── metrics.go
│ ├── traces.go
│ ├── logs.go
│ ├── propagation.go
│ └── *_test.go
├── examples/ # Example applications
├── docs/ # Documentation
├── scripts/ # Build and utility scripts
├── go.work # Go workspace file
└── README.md # This file
This project is licensed under the MIT License - see the LICENSE file for details.
- Mono Framework - The core modular monolith framework
- Mono Recipes - Example projects and recipes