Documentation
¶
Index ¶
- Constants
- func Auth(store authstore.Store, cfg config.AuthConfig) func(http.Handler) http.Handler
- func Cache(redisClient cacheReader, hasher *internalCache.SemanticHasher, ...) func(http.Handler) http.Handler
- func DashboardStats(store *dashboard.Store) func(http.Handler) http.Handler
- func GetAPIKey(ctx context.Context) string
- func GetOwner(ctx context.Context) string
- func GetRole(ctx context.Context) string
- func GetTier(ctx context.Context) string
- func Logging() func(http.Handler) http.Handler
- func Metrics() func(http.Handler) http.Handler
- func RateLimit(bucket *ratelimit.TokenBucket, cfg config.RateLimitConfig) func(http.Handler) http.Handler
- func Recovery() func(http.Handler) http.Handler
- func RequireRole(roles ...string) func(http.Handler) http.Handler
Constants ¶
View Source
const RequestBodyContextKey requestBodyKey = "request_body"
Variables ¶
This section is empty.
Functions ¶
func Cache ¶
func Cache( redisClient cacheReader, hasher *internalCache.SemanticHasher, ttlMgr cacheWriter, cfg config.CacheConfig, ) func(http.Handler) http.Handler
Cache middleware checks Redis for cached responses and stores new ones. Cache keys are namespaced by API key so tenants never share cached data.
func DashboardStats ¶
DashboardStats records per-key stats for the dashboard views.
func RateLimit ¶
func RateLimit(bucket *ratelimit.TokenBucket, cfg config.RateLimitConfig) func(http.Handler) http.Handler
RateLimit middleware applies per-API-key token bucket rate limiting
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.