Help us shape the future of Go! Take the 2026 Go Developer Survey

chain

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 1 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	Append(middlewares ...Middleware) Chain
	Prepend(middlewares ...Middleware) Chain
	Then(h http.Handler) http.Handler
	ThenFunc(fn http.HandlerFunc) http.Handler
}

Chain defines a chain of middleware.

func New

func New(middlewares ...Middleware) Chain

New creates a new Chain, memorizing the given list of middleware middlewares. New serves no other function, middlewares are only called upon a call to Then() or ThenFunc().

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware is an HTTP middleware.

Jump to

Keyboard shortcuts

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