Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsExemptFromRateLimits ¶
IsExemptFromRateLimits returns true if the request's API key tier is exempt from rate limits. Enterprise and Partner tiers are exempt from wallet/IP rate limits.
func Middleware ¶
Middleware validates API keys and stores tier information in request context. If no API key is provided or key is invalid, request proceeds with TierFree (default rate limits apply). If valid API key is provided, tier is stored in context for rate limit exemptions.
func ShouldBypassGlobalLimit ¶
ShouldBypassGlobalLimit returns true if the request should bypass global rate limits. Only Partner tier bypasses global limits (to prevent bulk import issues).
Types ¶
type Config ¶
type Config struct {
// APIKeys maps API key to tier level.
// Example: {"pro_abc123": TierPro, "enterprise_xyz789": TierEnterprise}
APIKeys map[string]Tier
// Enabled controls whether API key authentication is active.
Enabled bool
}
Config holds API key configuration.
Click to show internal directories.
Click to hide internal directories.