middleware

package
v1.0.0-rc.7 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQUEST_LOG_FIELD_DURATION       configura.Variable[string] = "REQUEST_LOG_FIELD_DURATION"
	REQUEST_LOG_FIELD_REQUEST_METHOD configura.Variable[string] = "REQUEST_LOG_FIELD_REQUEST_METHOD"
	REQUEST_LOG_FIELD_REQUEST_URL    configura.Variable[string] = "REQUEST_LOG_FIELD_REQUEST_URL"
	REQUEST_LOG_FIELD_USER_AGENT     configura.Variable[string] = "REQUEST_LOG_FIELD_USER_AGENT"
	REQUEST_LOG_FIELD_REQUEST_SIZE   configura.Variable[string] = "REQUEST_LOG_FIELD_REQUEST_SIZE"
	REQUEST_LOG_FIELD_REMOTE_IP      configura.Variable[string] = "REQUEST_LOG_FIELD_REMOTE_IP"
	REQUEST_LOG_FIELD_REFERER        configura.Variable[string] = "REQUEST_LOG_FIELD_REFERER"
	REQUEST_LOG_FIELD_PROTOCOL       configura.Variable[string] = "REQUEST_LOG_FIELD_PROTOCOL"
	REQUEST_LOG_FIELD_REQUEST_ID     configura.Variable[string] = "REQUEST_LOG_FIELD_REQUEST_ID"
	REQUEST_LOG_FIELD_REAL_IP        configura.Variable[string] = "REQUEST_LOG_FIELD_REAL_IP"
	REQUEST_LOG_FIELD_STATUS_CODE    configura.Variable[string] = "REQUEST_LOG_FIELD_STATUS_CODE"
	REQUEST_LOG_FIELD_RESPONSE_SIZE  configura.Variable[string] = "REQUEST_LOG_FIELD_RESPONSE_SIZE"
	REQUEST_LOG_FIELD_HOST           configura.Variable[string] = "REQUEST_LOG_FIELD_HOST"
	REQUEST_LOG_FIELD_FINGERPRINT    configura.Variable[string] = "REQUEST_LOG_FIELD_FINGERPRINT"
)
View Source
const (
	HTTP_HEADER_REAL_IP_OVERRIDE configura.Variable[string] = "HTTP_HEADER_REAL_IP" // Header to check for real IP address
)

Variables

This section is empty.

Functions

func GetIPAddressFromContext

func GetIPAddressFromContext(ctx context.Context) string

GetIPAddressFromContext retrieves the IP address from the context.

func IPAddress

func IPAddress(cfg configura.Config) func(http.Handler) http.Handler

IPAddress is a middleware that extracts the IP address from the request and stores it in the request context.

func LogRequest

func LogRequest(cfg configura.Config) func(http.Handler) http.Handler

LogRequest is a middleware that logs the request details on each request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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