MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Chain

Function Chain

pkg/webmiddleware/webmiddleware.go:24–29  ·  view source on GitHub ↗

Chain returns a http.Handler that chains the middleware onion-style around the handler.

(middlewares []MiddlewareFunc, handler http.Handler)

Source from the content-addressed store, hash-verified

22
23// Chain returns a http.Handler that chains the middleware onion-style around the handler.
24func Chain(middlewares []MiddlewareFunc, handler http.Handler) http.Handler {
25 for i := len(middlewares) - 1; i >= 0; i-- {
26 handler = middlewares[i](handler)
27 }
28 return handler
29}
30
31// Conditional is a middleware that only executes middleware if the condition
32// returns true for the request. If the condition returns false, the middleware

Callers 2

RegisterRoutesMethod · 0.92
TestChainFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestChainFunction · 0.68