MCPcopy
hub / github.com/grafana/dskit / Merge

Function Merge

middleware/middleware.go:30–37  ·  view source on GitHub ↗

Merge produces a middleware that applies multiple middlesware in turn; ie Merge(f,g,h).Wrap(handler) == f.Wrap(g.Wrap(h.Wrap(handler)))

(middlesware ...Interface)

Source from the content-addressed store, hash-verified

28// Merge produces a middleware that applies multiple middlesware in turn;
29// ie Merge(f,g,h).Wrap(handler) == f.Wrap(g.Wrap(h.Wrap(handler)))
30func Merge(middlesware ...Interface) Interface {
31 return Func(func(next http.Handler) http.Handler {
32 for i := len(middlesware) - 1; i >= 0; i-- {
33 next = middlesware[i].Wrap(next)
34 }
35 return next
36 })
37}
38
39type RoundTripperFunc func(*http.Request) (*http.Response, error)
40

Calls 2

FuncFuncType · 0.85
WrapMethod · 0.65