middleware

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: Apache-2.0 Imports: 1 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 is a function that wraps an http.Handler

func Chain

func Chain(middlewares ...Middleware) Middleware

Chain applies multiple middleware functions in order. The first middleware in the slice is the outermost (executed first).

type RouteBuilder

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

RouteBuilder provides a fluent API for building routes with middleware chains

func NewRouteBuilder

func NewRouteBuilder(mux *http.ServeMux) *RouteBuilder

NewRouteBuilder creates a new RouteBuilder with the given ServeMux

func (*RouteBuilder) Group

func (rb *RouteBuilder) Group(middlewares ...Middleware) *RouteBuilder

Group creates a new RouteBuilder with additional middlewares This is useful for grouping routes with common middleware

func (*RouteBuilder) Handle

func (rb *RouteBuilder) Handle(pattern string, handler http.Handler)

Handle registers a handler with the middleware chain

func (*RouteBuilder) HandleFunc

func (rb *RouteBuilder) HandleFunc(pattern string, handlerFunc http.HandlerFunc)

HandleFunc registers a handler function with the middleware chain

func (*RouteBuilder) With

func (rb *RouteBuilder) With(middlewares ...Middleware) *RouteBuilder

With adds middlewares to the chain

Directories

Path Synopsis
auth
jwt

Jump to

Keyboard shortcuts

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