middlewares

package
v0.6.13 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientAddr       httpfx.ContextKey = "client-addr"
	ClientAddrIp     httpfx.ContextKey = "client-addr-ip"
	ClientAddrOrigin httpfx.ContextKey = "client-addr-origin"
)
View Source
const AccessControlAllowOriginHeader = "Access-Control-Allow-Origin"
View Source
const (
	ContextKeyAuthClaims httpfx.ContextKey = "claims"
)
View Source
const CorrelationIdHeader = "X-Correlation-Id"
View Source
const ResponseTimeHeader = "X-Request-Time"

Variables

View Source
var ErrInvalidSigningMethod = results.Define("ERRBHMA001", "Invalid signing method") //nolint:gochecknoglobals

Functions

func AuthMiddleware

func AuthMiddleware() httpfx.Handler

func CorrelationIdMiddleware

func CorrelationIdMiddleware() httpfx.Handler

func CorsMiddleware

func CorsMiddleware() httpfx.Handler

func DetectLocalNetwork

func DetectLocalNetwork(requestAddr string) (bool, error)

func ErrorHandlerMiddleware

func ErrorHandlerMiddleware() httpfx.Handler

func GetClientAddrs

func GetClientAddrs(req *http.Request) string

func MetricsMiddleware

func MetricsMiddleware(httpMetrics *httpfx.Metrics) httpfx.Handler

func ResolveAddressMiddleware

func ResolveAddressMiddleware() httpfx.Handler

func ResponseTimeMiddleware

func ResponseTimeMiddleware() httpfx.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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