middleware

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIKeyHeader is the header that contains the API key.
	APIKeyHeader = "X-API-KEY"
)

Variables

This section is empty.

Functions

func Apply

func Apply(server *handle.Server, options handle.MiddlewareOptions) http.Handler

Apply applies the middleware to the handler.

func WriteErrorBody

func WriteErrorBody(ctx context.Context, code int, message string, writer http.ResponseWriter)

WriteErrorBody writes the given error message to the given ResponseWriter in the appropriate format.

Types

type Middleware

type Middleware func(next http.Handler) http.Handler

Middleware is a function that wraps a handler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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