mw

package
v0.0.0-...-9c53d89 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(opts ...*AuthOpts) fibre.MiddlewareFunc

Auth defines middleware for basic http authentication.

func Cors

func Cors(opts ...*CorsOpts) fibre.MiddlewareFunc

Cors defines middleware for setting and checking CORS headers,

func Fail

func Fail() fibre.MiddlewareFunc

Fail defines middleware for recovering from panics,

func Gzip

func Gzip() fibre.MiddlewareFunc

Gzip defines middleware for compressing response output.

func Info

func Info(opts ...*InfoOpts) fibre.MiddlewareFunc

Info defines middleware for specifying the server powered-by header.

func JWt

func JWt(opts ...*SignOpts) fibre.MiddlewareFunc

JWt defines middleware for JWT authentication.

func Logs

func Logs() fibre.MiddlewareFunc

Logs defines middleware for logging requests and responses.

func Quit

func Quit(opts ...*QuitOpts) fibre.MiddlewareFunc

Quit defines middleware for timing out a connection.

func Secure

func Secure(opts ...*SecureOpts) fibre.MiddlewareFunc

Secure defines middleware for specifying secure headers.

func Size

func Size(opts ...*SizeOpts) fibre.MiddlewareFunc

Size defines middleware for checking the request content length.

func Type

func Type(opts ...*TypeOpts) fibre.MiddlewareFunc

Type defines middleware for checking the request content type.

func Uniq

func Uniq(opts ...*UniqOpts) fibre.MiddlewareFunc

Uniq defines middleware for assigning a unique request id.

Types

type AuthOpts

type AuthOpts struct {
	User  []byte
	Pass  []byte
	Realm string
}

AuthOpts defines options for the Auth middleware.

type CorsOpts

type CorsOpts struct {
	AllowedOrigin                 string
	AllowedMethods                []string
	AllowedHeaders                []string
	AccessControlMaxAge           int
	AccessControlAllowCredentials bool
}

CorsOpts defines options for the Cors middleware.

type InfoOpts

type InfoOpts struct {
	PoweredBy string
}

InfoOpts defines options for the Info middleware.

type QuitOpts

type QuitOpts struct {
	Timeout time.Duration
}

QuitOpts defines options for the Sign middleware.

type SecureOpts

type SecureOpts struct {
	RedirectHTTP          bool
	XSSProtection         string
	FrameOptions          string
	ContentTypeOptions    string
	HSTSMaxAge            int
	HSTSIncludeSubdomains bool
	ContentSecurityPolicy string
	PublicKeyPins         string
}

SecureOpts defines options for the Secure middleware.

type SignOpts

type SignOpts struct {
	Key []byte
	Fnc func(*fibre.Context, map[string]interface{}, map[string]interface{}) error
}

SignOpts defines options for the JWt middleware.

type SizeOpts

type SizeOpts struct {
	AllowedLength int64
}

SizeOpts defines options for the Head middleware.

type TypeOpts

type TypeOpts struct {
	AllowedContent map[string]bool
}

TypeOpts defines options for the Type middleware.

type UniqOpts

type UniqOpts struct {
	HeaderKey string
}

UniqOpts defines options for the Uniq middleware.

Jump to

Keyboard shortcuts

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