Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientIPMiddleware ¶
NewClientIPMiddleware returns a middleware function that extracts the client's IP address from the request and adds it to the request's context. The IP address is obtained using the provided IP address provider. The middleware function takes the next http.Handler as input and returns a new http.Handler that wraps the provided handler. When the new handler is called, it first extracts the client's IP address from the request using the provider, adds it to the request's context, and then calls the next handler in the chain. The IP address can be accessed from the request's context using the ClientIP key.
func NewStashMiddleware ¶
NewStashMiddleware returns a middleware function that adds a stash to the request context. The stash is a synchronized map that can be used to store and retrieve values during the connection lifecycle. The middleware function takes the next http.Handler as input and returns a new http.Handler that wraps the next handler. The returned handler adds the stash to the request context and then calls the next handler to process the request.