Help us shape the future of Go! Take the 2026 Go Developer Survey

middleware

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register deprecated added in v0.6.0

func Register(names []string, handler CreateMiddlewareHandler) error

Register registers a legacy middleware handler.

Deprecated: use RegisterTyped instead.

func RegisterTyped added in v0.8.0

func RegisterTyped[T any](names []string, handler func(T) (app.HandlerFunc, error)) error

RegisterTyped registers a middleware with a strongly typed config struct. It automatically handles the decoding of generic params (map[string]any) into struct T.

Types

type CreateMiddlewareHandler

type CreateMiddlewareHandler func(param any) (app.HandlerFunc, error)

CreateMiddlewareHandler is a function that creates an app.HandlerFunc from parameters.

func Factory added in v0.6.0

func Factory(kind string) CreateMiddlewareHandler

Factory returns a middleware creator for the given kind.

Jump to

Keyboard shortcuts

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