middle

package module
v6.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 2 Imported by: 0

README

Middle

Go HTTP middleware I like to use.

Usage

Checkout the examples directory for usage examples.

Compatibility

As this package only depends on net/http package APIs, it can be used in any framework or libraries that uses types exposed by net/http package, e.g., github.com/julienschmidt/httprouter.

Limitations

This package exposes middleware functions chain builders for up to 27 functions, i.e., Chain1 up to Chain27. Although I think this is way more than enough for most of applications, I plan to improve the generator so you can generate your middle.ChainN up to any number of N you need by using it. See generator for more.

Using Generator

See gen command line flags, and ./gen.go for an example of usage.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAbort can be used to stop the middleware chain execution.
	ErrAbort = errors.New("chain execution stopped")
)

Functions

This section is empty.

Types

type ChainHandler1

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

ChainHandler1 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler1.Finally by satisfying net/http.HandlerFunc

func Chain1

Chain1 creates a chain of exactly 1 function that will be executed in order.

func (ChainHandler1) Finally

func (chain ChainHandler1) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware function registered via Chain1, passing request, and response to it.

func (ChainHandler1) ServeHTTP

func (chain ChainHandler1) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes the handler function, passing request, and response to it.

type ChainHandler10

type ChainHandler10[A any, B any, C any, D any, E any, F any, G any, H any, I any] struct {
	// contains filtered or unexported fields
}

ChainHandler10 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler10.Finally by satisfying net/http.HandlerFunc

func Chain10

func Chain10[A any, B any, C any, D any, E any, F any, G any, H any, I any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) error) ChainHandler10[A, B, C, D, E, F, G, H, I]

Chain10 creates a chain of exactly 10 functions that will be executed in order.

func (ChainHandler10[A, B, C, D, E, F, G, H, I]) Finally

func (chain ChainHandler10[A, B, C, D, E, F, G, H, I]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain10 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler10[A, B, C, D, E, F, G, H, I]) ServeHTTP

func (chain ChainHandler10[A, B, C, D, E, F, G, H, I]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler11

type ChainHandler11[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any] struct {
	// contains filtered or unexported fields
}

ChainHandler11 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler11.Finally by satisfying net/http.HandlerFunc

func Chain11

func Chain11[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) error) ChainHandler11[A, B, C, D, E, F, G, H, I, J]

Chain11 creates a chain of exactly 11 functions that will be executed in order.

func (ChainHandler11[A, B, C, D, E, F, G, H, I, J]) Finally

func (chain ChainHandler11[A, B, C, D, E, F, G, H, I, J]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain11 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler11[A, B, C, D, E, F, G, H, I, J]) ServeHTTP

func (chain ChainHandler11[A, B, C, D, E, F, G, H, I, J]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler12

type ChainHandler12[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any] struct {
	// contains filtered or unexported fields
}

ChainHandler12 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler12.Finally by satisfying net/http.HandlerFunc

func Chain12

func Chain12[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) error) ChainHandler12[A, B, C, D, E, F, G, H, I, J, K]

Chain12 creates a chain of exactly 12 functions that will be executed in order.

func (ChainHandler12[A, B, C, D, E, F, G, H, I, J, K]) Finally

func (chain ChainHandler12[A, B, C, D, E, F, G, H, I, J, K]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain12 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler12[A, B, C, D, E, F, G, H, I, J, K]) ServeHTTP

func (chain ChainHandler12[A, B, C, D, E, F, G, H, I, J, K]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler13

type ChainHandler13[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any] struct {
	// contains filtered or unexported fields
}

ChainHandler13 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler13.Finally by satisfying net/http.HandlerFunc

func Chain13

func Chain13[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) error) ChainHandler13[A, B, C, D, E, F, G, H, I, J, K, L]

Chain13 creates a chain of exactly 13 functions that will be executed in order.

func (ChainHandler13[A, B, C, D, E, F, G, H, I, J, K, L]) Finally

func (chain ChainHandler13[A, B, C, D, E, F, G, H, I, J, K, L]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain13 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler13[A, B, C, D, E, F, G, H, I, J, K, L]) ServeHTTP

func (chain ChainHandler13[A, B, C, D, E, F, G, H, I, J, K, L]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler14

type ChainHandler14[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any] struct {
	// contains filtered or unexported fields
}

ChainHandler14 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler14.Finally by satisfying net/http.HandlerFunc

func Chain14

func Chain14[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) error) ChainHandler14[A, B, C, D, E, F, G, H, I, J, K, L, M]

Chain14 creates a chain of exactly 14 functions that will be executed in order.

func (ChainHandler14[A, B, C, D, E, F, G, H, I, J, K, L, M]) Finally

func (chain ChainHandler14[A, B, C, D, E, F, G, H, I, J, K, L, M]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain14 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler14[A, B, C, D, E, F, G, H, I, J, K, L, M]) ServeHTTP

func (chain ChainHandler14[A, B, C, D, E, F, G, H, I, J, K, L, M]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler15

type ChainHandler15[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any] struct {
	// contains filtered or unexported fields
}

ChainHandler15 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler15.Finally by satisfying net/http.HandlerFunc

func Chain15

func Chain15[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) error) ChainHandler15[A, B, C, D, E, F, G, H, I, J, K, L, M, N]

Chain15 creates a chain of exactly 15 functions that will be executed in order.

func (ChainHandler15[A, B, C, D, E, F, G, H, I, J, K, L, M, N]) Finally

func (chain ChainHandler15[A, B, C, D, E, F, G, H, I, J, K, L, M, N]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain15 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler15[A, B, C, D, E, F, G, H, I, J, K, L, M, N]) ServeHTTP

func (chain ChainHandler15[A, B, C, D, E, F, G, H, I, J, K, L, M, N]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler16

type ChainHandler16[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any] struct {
	// contains filtered or unexported fields
}

ChainHandler16 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler16.Finally by satisfying net/http.HandlerFunc

func Chain16

func Chain16[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) error) ChainHandler16[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O]

Chain16 creates a chain of exactly 16 functions that will be executed in order.

func (ChainHandler16[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O]) Finally

func (chain ChainHandler16[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain16 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler16[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O]) ServeHTTP

func (chain ChainHandler16[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler17

type ChainHandler17[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any] struct {
	// contains filtered or unexported fields
}

ChainHandler17 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler17.Finally by satisfying net/http.HandlerFunc

func Chain17

func Chain17[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) error) ChainHandler17[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P]

Chain17 creates a chain of exactly 17 functions that will be executed in order.

func (ChainHandler17[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P]) Finally

func (chain ChainHandler17[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain17 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler17[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P]) ServeHTTP

func (chain ChainHandler17[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler18

type ChainHandler18[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any] struct {
	// contains filtered or unexported fields
}

ChainHandler18 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler18.Finally by satisfying net/http.HandlerFunc

func Chain18

func Chain18[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) error) ChainHandler18[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q]

Chain18 creates a chain of exactly 18 functions that will be executed in order.

func (ChainHandler18[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q]) Finally

func (chain ChainHandler18[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain18 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler18[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q]) ServeHTTP

func (chain ChainHandler18[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler19

type ChainHandler19[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any] struct {
	// contains filtered or unexported fields
}

ChainHandler19 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler19.Finally by satisfying net/http.HandlerFunc

func Chain19

func Chain19[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) error) ChainHandler19[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R]

Chain19 creates a chain of exactly 19 functions that will be executed in order.

func (ChainHandler19[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R]) Finally

func (chain ChainHandler19[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain19 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler19[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R]) ServeHTTP

func (chain ChainHandler19[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler2

type ChainHandler2[A any] struct {
	// contains filtered or unexported fields
}

ChainHandler2 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler2.Finally by satisfying net/http.HandlerFunc

func Chain2

func Chain2[A any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) error) ChainHandler2[A]

Chain2 creates a chain of exactly 2 functions that will be executed in order.

func (ChainHandler2[A]) Finally

func (chain ChainHandler2[A]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain2 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler2[A]) ServeHTTP

func (chain ChainHandler2[A]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler20

type ChainHandler20[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any] struct {
	// contains filtered or unexported fields
}

ChainHandler20 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler20.Finally by satisfying net/http.HandlerFunc

func Chain20

func Chain20[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) (S, error), f20 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) error) ChainHandler20[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S]

Chain20 creates a chain of exactly 20 functions that will be executed in order.

func (ChainHandler20[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S]) Finally

func (chain ChainHandler20[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain20 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler20[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S]) ServeHTTP

func (chain ChainHandler20[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler21

type ChainHandler21[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any] struct {
	// contains filtered or unexported fields
}

ChainHandler21 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler21.Finally by satisfying net/http.HandlerFunc

func Chain21

func Chain21[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) (S, error), f20 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) (T, error), f21 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) error) ChainHandler21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T]

Chain21 creates a chain of exactly 21 functions that will be executed in order.

func (ChainHandler21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T]) Finally

func (chain ChainHandler21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain21 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T]) ServeHTTP

func (chain ChainHandler21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler22

type ChainHandler22[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any] struct {
	// contains filtered or unexported fields
}

ChainHandler22 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler22.Finally by satisfying net/http.HandlerFunc

func Chain22

func Chain22[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) (S, error), f20 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) (T, error), f21 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) (U, error), f22 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) error) ChainHandler22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]

Chain22 creates a chain of exactly 22 functions that will be executed in order.

func (ChainHandler22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]) Finally

func (chain ChainHandler22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain22 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]) ServeHTTP

func (chain ChainHandler22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler23

type ChainHandler23[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any] struct {
	// contains filtered or unexported fields
}

ChainHandler23 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler23.Finally by satisfying net/http.HandlerFunc

func Chain23

func Chain23[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) (S, error), f20 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) (T, error), f21 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) (U, error), f22 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) (V, error), f23 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) error) ChainHandler23[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V]

Chain23 creates a chain of exactly 23 functions that will be executed in order.

func (ChainHandler23[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V]) Finally

func (chain ChainHandler23[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain23 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler23[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V]) ServeHTTP

func (chain ChainHandler23[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler24

type ChainHandler24[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any, W any] struct {
	// contains filtered or unexported fields
}

ChainHandler24 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler24.Finally by satisfying net/http.HandlerFunc

func Chain24

func Chain24[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any, W any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) (S, error), f20 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) (T, error), f21 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) (U, error), f22 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) (V, error), f23 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) (W, error), f24 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) error) ChainHandler24[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W]

Chain24 creates a chain of exactly 24 functions that will be executed in order.

func (ChainHandler24[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W]) Finally

func (chain ChainHandler24[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain24 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler24[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W]) ServeHTTP

func (chain ChainHandler24[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler25

type ChainHandler25[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any, W any, X any] struct {
	// contains filtered or unexported fields
}

ChainHandler25 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler25.Finally by satisfying net/http.HandlerFunc

func Chain25

func Chain25[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any, W any, X any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) (S, error), f20 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) (T, error), f21 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) (U, error), f22 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) (V, error), f23 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) (W, error), f24 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) (X, error), f25 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) error) ChainHandler25[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X]

Chain25 creates a chain of exactly 25 functions that will be executed in order.

func (ChainHandler25[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X]) Finally

func (chain ChainHandler25[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain25 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler25[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X]) ServeHTTP

func (chain ChainHandler25[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler26

type ChainHandler26[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any, W any, X any, Y any] struct {
	// contains filtered or unexported fields
}

ChainHandler26 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler26.Finally by satisfying net/http.HandlerFunc

func Chain26

func Chain26[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any, W any, X any, Y any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) (S, error), f20 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) (T, error), f21 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) (U, error), f22 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) (V, error), f23 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) (W, error), f24 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) (X, error), f25 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) (Y, error), f26 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y) error) ChainHandler26[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y]

Chain26 creates a chain of exactly 26 functions that will be executed in order.

func (ChainHandler26[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y]) Finally

func (chain ChainHandler26[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain26 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler26[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y]) ServeHTTP

func (chain ChainHandler26[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler27

type ChainHandler27[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any, W any, X any, Y any, Z any] struct {
	// contains filtered or unexported fields
}

ChainHandler27 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler27.Finally by satisfying net/http.HandlerFunc

func Chain27

func Chain27[A any, B any, C any, D any, E any, F any, G any, H any, I any, J any, K any, L any, M any, N any, O any, P any, Q any, R any, S any, T any, U any, V any, W any, X any, Y any, Z any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) (I, error), f10 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I) (J, error), f11 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J) (K, error), f12 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K) (L, error), f13 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L) (M, error), f14 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M) (N, error), f15 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N) (O, error), f16 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) (P, error), f17 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) (Q, error), f18 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) (R, error), f19 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) (S, error), f20 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) (T, error), f21 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) (U, error), f22 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) (V, error), f23 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) (W, error), f24 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) (X, error), f25 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) (Y, error), f26 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y) (Z, error), f27 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) error) ChainHandler27[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]

Chain27 creates a chain of exactly 27 functions that will be executed in order.

func (ChainHandler27[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]) Finally

func (chain ChainHandler27[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain27 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler27[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]) ServeHTTP

func (chain ChainHandler27[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler3

type ChainHandler3[A any, B any] struct {
	// contains filtered or unexported fields
}

ChainHandler3 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler3.Finally by satisfying net/http.HandlerFunc

func Chain3

func Chain3[A any, B any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) error) ChainHandler3[A, B]

Chain3 creates a chain of exactly 3 functions that will be executed in order.

func (ChainHandler3[A, B]) Finally

func (chain ChainHandler3[A, B]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain3 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler3[A, B]) ServeHTTP

func (chain ChainHandler3[A, B]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler4

type ChainHandler4[A any, B any, C any] struct {
	// contains filtered or unexported fields
}

ChainHandler4 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler4.Finally by satisfying net/http.HandlerFunc

func Chain4

func Chain4[A any, B any, C any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) error) ChainHandler4[A, B, C]

Chain4 creates a chain of exactly 4 functions that will be executed in order.

func (ChainHandler4[A, B, C]) Finally

func (chain ChainHandler4[A, B, C]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain4 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler4[A, B, C]) ServeHTTP

func (chain ChainHandler4[A, B, C]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler5

type ChainHandler5[A any, B any, C any, D any] struct {
	// contains filtered or unexported fields
}

ChainHandler5 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler5.Finally by satisfying net/http.HandlerFunc

func Chain5

func Chain5[A any, B any, C any, D any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) error) ChainHandler5[A, B, C, D]

Chain5 creates a chain of exactly 5 functions that will be executed in order.

func (ChainHandler5[A, B, C, D]) Finally

func (chain ChainHandler5[A, B, C, D]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain5 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler5[A, B, C, D]) ServeHTTP

func (chain ChainHandler5[A, B, C, D]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler6

type ChainHandler6[A any, B any, C any, D any, E any] struct {
	// contains filtered or unexported fields
}

ChainHandler6 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler6.Finally by satisfying net/http.HandlerFunc

func Chain6

func Chain6[A any, B any, C any, D any, E any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) error) ChainHandler6[A, B, C, D, E]

Chain6 creates a chain of exactly 6 functions that will be executed in order.

func (ChainHandler6[A, B, C, D, E]) Finally

func (chain ChainHandler6[A, B, C, D, E]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain6 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler6[A, B, C, D, E]) ServeHTTP

func (chain ChainHandler6[A, B, C, D, E]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler7

type ChainHandler7[A any, B any, C any, D any, E any, F any] struct {
	// contains filtered or unexported fields
}

ChainHandler7 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler7.Finally by satisfying net/http.HandlerFunc

func Chain7

func Chain7[A any, B any, C any, D any, E any, F any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) error) ChainHandler7[A, B, C, D, E, F]

Chain7 creates a chain of exactly 7 functions that will be executed in order.

func (ChainHandler7[A, B, C, D, E, F]) Finally

func (chain ChainHandler7[A, B, C, D, E, F]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain7 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler7[A, B, C, D, E, F]) ServeHTTP

func (chain ChainHandler7[A, B, C, D, E, F]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler8

type ChainHandler8[A any, B any, C any, D any, E any, F any, G any] struct {
	// contains filtered or unexported fields
}

ChainHandler8 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler8.Finally by satisfying net/http.HandlerFunc

func Chain8

func Chain8[A any, B any, C any, D any, E any, F any, G any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) error) ChainHandler8[A, B, C, D, E, F, G]

Chain8 creates a chain of exactly 8 functions that will be executed in order.

func (ChainHandler8[A, B, C, D, E, F, G]) Finally

func (chain ChainHandler8[A, B, C, D, E, F, G]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain8 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler8[A, B, C, D, E, F, G]) ServeHTTP

func (chain ChainHandler8[A, B, C, D, E, F, G]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

type ChainHandler9

type ChainHandler9[A any, B any, C any, D any, E any, F any, G any, H any] struct {
	// contains filtered or unexported fields
}

ChainHandler9 provides capability of processing chain functions in order by satisfying net/http.Handler, or with an optional chain error handler via ChainHandler9.Finally by satisfying net/http.HandlerFunc

func Chain9

func Chain9[A any, B any, C any, D any, E any, F any, G any, H any](f1 func(http.ResponseWriter, *http.Request) (A, error), f2 func(http.ResponseWriter, *http.Request, A) (B, error), f3 func(http.ResponseWriter, *http.Request, A, B) (C, error), f4 func(http.ResponseWriter, *http.Request, A, B, C) (D, error), f5 func(http.ResponseWriter, *http.Request, A, B, C, D) (E, error), f6 func(http.ResponseWriter, *http.Request, A, B, C, D, E) (F, error), f7 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F) (G, error), f8 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G) (H, error), f9 func(http.ResponseWriter, *http.Request, A, B, C, D, E, F, G, H) error) ChainHandler9[A, B, C, D, E, F, G, H]

Chain9 creates a chain of exactly 9 functions that will be executed in order.

func (ChainHandler9[A, B, C, D, E, F, G, H]) Finally

func (chain ChainHandler9[A, B, C, D, E, F, G, H]) Finally(catch func(http.ResponseWriter, *http.Request, error)) http.HandlerFunc

Finally executes middleware functions registered via Chain9 in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops, and executes catch with that error. If the error is ErrAbort according to errors.Is semantics, it is ignored, and catch will not be called, although the chain execution stops.

func (ChainHandler9[A, B, C, D, E, F, G, H]) ServeHTTP

func (chain ChainHandler9[A, B, C, D, E, F, G, H]) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP satisfies net/http.Handler. It executes functions in the chain in order, passing results of all previous function calls to it. If any of the functions in the chain returns a non-nil error, the execution stops.

Directories

Path Synopsis
examples
gen

Jump to

Keyboard shortcuts

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