chain

package
v0.0.0-...-018885d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 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 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