middleware

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS added in v0.2.0

func CORS(options CORSOptions) func(http.Handler) http.Handler

CORS returns a Middleware that handles Cross-Origin Resource Sharing.

func ContentLengthMiddleware added in v0.2.0

func ContentLengthMiddleware(next http.Handler) http.Handler

ContentLengthMiddleware automatically sets the Content-Length header

func Recover added in v0.2.0

func Recover(next http.Handler) http.Handler

func Timer

func Timer(next http.Handler) http.Handler

Types

type CORSOptions added in v0.2.0

type CORSOptions struct {
	AllowedOrigins   []string
	AllowedMethods   []string
	AllowedHeaders   []string
	ExposedHeaders   []string
	AllowCredentials bool
	MaxAge           int
}

Jump to

Keyboard shortcuts

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