middleware

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware defines a function that wraps an http.Handler.

func NewRequestIDMiddleware

func NewRequestIDMiddleware() Middleware

NewRequestIDMiddleware creates a new middleware instance for request ID management

type ObservabilityConfig

type ObservabilityConfig struct {
	Enabled  bool
	EventBus eventbus.EventBus
	// MaxRequestBodyBytes limits request body capture for observability events. 0 means "use default".
	MaxRequestBodyBytes int64
	// MaxResponseBodyBytes limits response body capture for observability events. 0 means "use default".
	MaxResponseBodyBytes int64
}

ObservabilityConfig controls the behavior of the observability middleware.

type ObservabilityMiddleware

type ObservabilityMiddleware struct {
	// contains filtered or unexported fields
}

ObservabilityMiddleware captures request/response data and forwards it to an event bus.

func NewObservabilityMiddleware

func NewObservabilityMiddleware(cfg ObservabilityConfig, logger *zap.Logger) *ObservabilityMiddleware

NewObservabilityMiddleware creates a new ObservabilityMiddleware instance.

func (*ObservabilityMiddleware) Middleware

func (m *ObservabilityMiddleware) Middleware() Middleware

Middleware returns the http middleware function.

type RequestIDMiddleware

type RequestIDMiddleware struct{}

RequestIDMiddleware handles request and correlation ID context propagation

Jump to

Keyboard shortcuts

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