chain

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain []Constructor

Chain enables easy definition of custom handler chains.

func New

func New(cc ...Constructor) Chain

New creates a new chain with the supplied Constructors.

func (Chain) Append

func (c Chain) Append(cc ...Constructor) Chain

Append adds the Constructor to the end of the execution chain.

func (Chain) Handler

func (c Chain) Handler(h http.Handler) http.Handler

Handler compiles the chain to a single RequestHandler.

func (Chain) Prepend

func (c Chain) Prepend(cc ...Constructor) Chain

Prepend adds the Constructor to the start of the execution chain.

type Constructor

type Constructor func(http.Handler) http.Handler

Constructor is the function contract used to make RequestHandlers.

Jump to

Keyboard shortcuts

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