middleware

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deadline

func Deadline(
	fallback time.Duration,
	corrector func(time.Time, bool) time.Time,
) func(http.Handler) http.Handler

Deadline returns the Middleware to inject a deadline timestamp into the request context.

func HardTimeout added in v0.0.16

func HardTimeout(timeout time.Duration) func(http.Handler) http.Handler

HardTimeout returns the Middleware to inject the timeout duration into the request context. The difference between the method and the Timeout middleware is a more strict guarantee about the time execution.

func Timeout

func Timeout(
	fallback time.Duration,
	corrector func(time.Duration, bool) time.Duration,
) func(http.Handler) http.Handler

Timeout returns the Middleware to inject a timeout duration into the request context.

func Tracer added in v0.0.12

func Tracer(buffer int, logger func(*tracer.Trace)) func(http.Handler) http.Handler

Tracer returns the Middleware to inject a simple tracer into the request context.

Types

type Stack added in v0.0.12

type Stack []func(http.Handler) http.Handler

Stack provides the method to wrap a Handler.

func (Stack) Apply added in v0.0.12

func (stack Stack) Apply(handler http.Handler) http.Handler

Apply wraps the Handler by the Stack of another handlers.

type Type added in v0.0.20

type Type func(http.Handler) http.Handler

Type defines a Handler wrapper.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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