Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRateLimit ¶
func CheckRateLimit( w http.ResponseWriter, r *http.Request, endpoint string, disableRateLimit bool, customCheck func(ip string, endpoint string) (allowed bool, retryAfter time.Duration, err error), limiter *utils.InMemoryRateLimiter, hooks types.ObservabilityHooks, ) bool
CheckRateLimit verifies if a request should be allowed based on rate limiting rules. It returns true if allowed, false if rate limited.
func GetClientIP ¶
GetClientIP extracts the client IP from the request. It checks X-Forwarded-For and X-Real-IP headers first, then falls back to RemoteAddr.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.