middleware

package
v0.0.0-...-98f0a1a Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHijackerNotSupported = errors.New("http.Hijacker interface is not supported")

Functions

func GetRequestID

func GetRequestID(r *http.Request) string

GetRequestID returns the request identifier

func MaxRequestSize

func MaxRequestSize(next http.Handler, maxReqSize uint64) http.Handler

func NewLogMiddleware

func NewLogMiddleware(next http.Handler, log *slog.Logger) http.Handler

func Redirect

func Redirect(_ http.Handler, port int) http.Handler

func TLSAddr

func TLSAddr(host string, forcePort bool, sslPort int) string

TLSAddr replaces listen or host port with port configured by SSLConfig config.

Types

type Middleware

type Middleware interface {
	Name() string
	Middleware(next http.Handler) http.Handler
}

type Middlewares

type Middlewares interface {
	HTTPMiddlewares() []interface{}
}

Jump to

Keyboard shortcuts

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