middleware

package
v0.0.0-...-3a75ae7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

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

func NewChain

func NewChain(middlewares ...Middleware) Chain

NewChain creates a new chain of middlewares.

func (Chain) Extend

func (c Chain) Extend(middlewares ...Middleware) Chain

Extend returns a new chain of middlewares that contains the middlewares of the current chain and the given middlewares.

func (Chain) Middleware

func (c Chain) Middleware(h http.Handler) http.Handler

Middleware wraps the given handler with all the middlewares in the chain.

type Middleware

type Middleware interface {
	// Middleware wraps the given handler with the middleware.
	Middleware(http.Handler) http.Handler
}

Middleware is a type that wraps an http.Handler with additional logic.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

MiddlewareFunc is a function that implements the Middleware interface.

func (MiddlewareFunc) Middleware

func (m MiddlewareFunc) Middleware(h http.Handler) http.Handler

Jump to

Keyboard shortcuts

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