chain

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package chain provides a generic chain-of-responsibility helper shared by the middleware and resilience packages, which define the same Handler/Middleware decorator shape but over different handler types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain[H any, M ~func(H) H](outer M, others ...M) M

Chain assembles middlewares so that the first argument is the outermost (executed first) and the last is the innermost (closest to the handler):

Chain(m1, m2, m3)(h) == m1(m2(m3(h)))

H is the handler type and M is the middleware decorator type ~func(H) H. This collapses the previously duplicated middleware.Chain and resilience.Chain implementations into one generic helper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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