Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedOrigin ¶
func CORSOptions ¶
func CORSOptions(config CORSConfig) cors.Options
Types ¶
type CORSConfig ¶
type CORSConfig struct { AllowedOrigins []string `long:"allowed-origins" description:"Allowed origins for CORS"` MaxAge int `long:"max-age" description:"Max age (in seconds) for preflight cache"` }
CORSConfig represents the configuration for CORS.
type RateLimit ¶
type RateLimit struct {
// contains filtered or unexported fields
}
func NewRateLimit ¶
func NewRateLimit(ctx context.Context, cfg RateLimitConfig) (*RateLimit, error)
func (*RateLimit) NewRequest ¶
NewRequest returns nil if the rate has not been exceeded.
type RateLimitConfig ¶
Click to show internal directories.
Click to hide internal directories.