Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIP ¶
GetIP gets a requests IP address by reading off the forwarded-for header (for proxies) and falls back to use the remote address.
func NewAPILimiter ¶
func NewAPILimiter(cfg *APILimiterConfig) error
Types ¶
type APILimiterConfig ¶
type APILimiterConfig struct { HTTPLimitCfg HTTPLimitConfig PathPattern map[string]MemoryLimiterConfig APILimits map[string]MemoryLimiterConfig // routePrefix-apiName => limit config HostPattern map[string]MemoryLimiterConfig }
type HTTPLimitConfig ¶
type MemoryLimiterConfig ¶
type RateLimiterCell ¶
type RateLimiterConfig ¶
type RateLimiterConfig struct { HTTPLimitCfg HTTPLimitConfig PathPattern []RateLimiterCell HostPattern []RateLimiterCell APILimits []RateLimiterCell }
Click to show internal directories.
Click to hide internal directories.