common

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: MIT Imports: 1 Imported by: 0

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

type Middleware func(http.Handler) http.Handler

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

Then applies the middleware chain to a handler

func (MiddlewareChain) ThenFunc added in v1.0.2

ThenFunc applies the middleware chain to a handler function

Jump to

Keyboard shortcuts

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