Documentation
¶
Overview ¶
Package common provides common utilities and interfaces for the SRouter framework.
Package common provides shared types and utilities used across the SRouter framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
Middleware is a function that wraps an http.Handler. It allows for pre-processing and post-processing of HTTP requests. Middleware can be chained together to create a pipeline of request processing.
type MiddlewareChain ¶ added in v1.0.2
type MiddlewareChain []Middleware
MiddlewareChain represents a chain of middleware
func NewMiddlewareChain ¶ added in v1.0.2
func NewMiddlewareChain(middlewares ...Middleware) MiddlewareChain
NewMiddlewareChain creates a new middleware chain
func (MiddlewareChain) Append ¶ added in v1.0.2
func (c MiddlewareChain) Append(middlewares ...Middleware) MiddlewareChain
Append adds middleware to the end of the chain
func (MiddlewareChain) Prepend ¶ added in v1.0.2
func (c MiddlewareChain) Prepend(middlewares ...Middleware) MiddlewareChain
Prepend adds middleware to the beginning of the chain
func (MiddlewareChain) Then ¶ added in v1.0.2
func (c MiddlewareChain) Then(h http.Handler) http.Handler
Then applies the middleware chain to a handler
func (MiddlewareChain) ThenFunc ¶ added in v1.0.2
func (c MiddlewareChain) ThenFunc(f http.HandlerFunc) http.Handler
ThenFunc applies the middleware chain to a handler function