zmiddlewares

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRequestMetrics

func RegisterRequestMetrics(appName string, metricsServer metrics.TaskMetrics) []error

Types

type CorsOptions

type CorsOptions struct {
	AllowedOrigins     []string
	AllowOriginFunc    func(r *http.Request, origin string) bool
	AllowedMethods     []string
	AllowedHeaders     []string
	ExposedHeaders     []string
	AllowCredentials   bool
	MaxAge             int
	OptionsPassthrough bool
	Debug              bool
}

type Middleware

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

func Cors

func Cors(options CorsOptions) Middleware

func DefaultCors

func DefaultCors() Middleware

func ErrorHandlerMiddleware

func ErrorHandlerMiddleware(logger *zap.SugaredLogger) Middleware

func Logger

func Logger() Middleware

func RateLimit

func RateLimit(maxRPM int) Middleware

func RequestID

func RequestID() Middleware

func RequestMetrics

func RequestMetrics(appName string, metricsServer metrics.TaskMetrics) Middleware

Jump to

Keyboard shortcuts

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