Documentation
¶
Index ¶
Constants ¶
View Source
const (
// AuthHeaderKey is the header key for API key authentication
AuthHeaderKey = "X-API-Key"
)
Variables ¶
This section is empty.
Functions ¶
func APIKeyAuth ¶
APIKeyAuth middleware checks for a valid API key in the request header
func LoggingMiddleware ¶
LoggingMiddleware logs information about each request
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter implements a token bucket rate limiter
func NewRateLimiter ¶
func NewRateLimiter(rate, bucketSize float64) *RateLimiter
NewRateLimiter creates a new rate limiter
Click to show internal directories.
Click to hide internal directories.