Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRateLimiter ¶
GetRateLimiter retrieves a rate limiter for a given IP address, creating one if it doesn't exist.
func NewProxy ¶
NewProxy initializes and returns a new reverse proxy pointing to the given host and port. It takes a remote host address, port, and a logger as its arguments.
func ProxyRequestHandler ¶
func ProxyRequestHandler(proxy *httputil.ReverseProxy) func(http.ResponseWriter, *http.Request)
ProxyRequestHandler returns a function suitable for use as an http.HandlerFunc. The returned function will use the provided ReverseProxy to proxy HTTP requests.
func RateLimiterMiddleware ¶
rateLimiterMiddleware checks if the incoming request exceeds the rate limit. If it does, the middleware responds with a "Too Many Requests" status and stops further processing.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.