middleware

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gzip

func Gzip(next http.Handler) http.Handler

Gzip is a middleware to enabling GZIP on HTTP requests

func Logger

func Logger(next http.Handler) http.Handler

Logger is a middleware to log HTTP request

func Noop added in v1.3.0

func Noop(next http.Handler) http.Handler

Noop is a middleware to do nothing, yes!

Types

type Middleware

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

Middleware function definition

func Cors

func Cors(allowOrigin string) Middleware

Cors is a middleware to enabling CORS on HTTP requests

func Methods

func Methods(methods ...string) Middleware

Methods is a middleware to check that the request use the correct HTTP method

type Middlewares added in v1.3.0

type Middlewares []Middleware

Middlewares list

func (Middlewares) UseAfter added in v1.3.0

func (ms Middlewares) UseAfter(m Middleware) Middlewares

UseAfter add a middleware at the end of the middleware chain

func (Middlewares) UseBefore added in v1.3.0

func (ms Middlewares) UseBefore(m Middleware) Middlewares

UseBefore insert a middleware at the begining of the middleware chain

Jump to

Keyboard shortcuts

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