middleware

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 13 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(realm string, credentials map[string]string) zoox.Middleware

func CORS added in v1.0.20

func CORS(cfg ...*CorsConfig) zoox.Middleware

func HealthCheck

func HealthCheck() zoox.Middleware

func Jwt added in v1.0.25

func Jwt(secret string, algorithm ...string) zoox.Middleware

func Logger

func Logger() zoox.Middleware

Logger is a middleware that logs the request as it goes through the handler.

func RealIP

func RealIP() zoox.Middleware

func Recovery

func Recovery() zoox.Middleware

Recovery is the recovery middleware

func Rewrite added in v1.0.20

func Rewrite(cfg ...*RewriteConfig) zoox.Middleware

func Timeout

func Timeout(timeout time.Duration) zoox.Middleware

Types

type CorsConfig added in v1.0.20

type CorsConfig struct {
	IgnoreFunc       func(ctx *zoox.Context) bool
	AllowOrigins     []string
	AllowOriginFunc  func(origin string) bool
	AllowMethods     []string
	AllowHeaders     []string
	AllowCredentials bool
	ExposeHeaders    []string
}

func DefaultCorsConfig added in v1.0.20

func DefaultCorsConfig() *CorsConfig

type RewriteConfig added in v1.0.20

type RewriteConfig struct {
	Rewrites map[string]string
}

Jump to

Keyboard shortcuts

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