chain

package
Version: v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 1 Imported by: 2

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.

Source Files

Jump to

Keyboard shortcuts

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