Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedOrigin ¶ added in v0.67.1
func CORSOptions ¶ added in v0.67.1
func CORSOptions(config CORSConfig) cors.Options
Types ¶
type CORSConfig ¶ added in v0.67.1
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.