middleware

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

Apply takes a base handler and a slice of middlewares, applying each one in the order they are given.

func GetNativeContext

func GetNativeContext(ctx *fasthttp.RequestCtx) context.Context

GetNativeContext retrieve a standard library context from FastHTTP request context.

func WithNativeContext

func WithNativeContext(ctx *fasthttp.RequestCtx, nativeCtx context.Context)

WithNativeContext stores a standard library context into FastHTTP request context.

Types

type Middleware

type Middleware interface {
	Apply(h fasthttp.RequestHandler) fasthttp.RequestHandler
}

Middleware defines a generic handler wrapper capable of controlling request flow.

func FetchEnabled

func FetchEnabled(log restql.Logger, cfg *conf.Config, pm plugins.Lifecycle) []Middleware

FetchEnabled returns all middlewares enabled in configuration

Jump to

Keyboard shortcuts

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