package
0.0.0-20230101183712-202847b4b89b
Repository: https://github.com/corestoreio/csfw.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

MustNew same as New() but panics on error.
New creates a new rate limit middleware.
NewOptionFactories creates a new struct and initializes the internal map for the registration of different option factories.
OptionsError helper function to be used within the backend package or other sub-packages whose functions may return an OptionFactoryFunc.
WithDebugLog creates a new standard library based logger with debug mode enabled.
WithDefaultConfig applies the default ratelimit configuration settings based for a specific scope.
WithDeniedHandler sets a custom denied handler for a specific scope.
WithDisable disables the current service and calls the next HTTP handler.
WithErrorHandler adds a custom error handler.
WithGCRAStore creates a new GCRA rate limiter with a custom storage backend.
WithLogger convenient helper function to apply a logger to the Service type.
WithMarkPartiallyApplied if set to true marks a configuration for a scope as partially applied with functional options set via source code.
WithOptionFactory applies a function which lazily loads the options from a slow backend (config.Getter) depending on the incoming scope within a request.
WithRateLimiter creates a rate limiter for a specific scope with its ID.
WithRootConfig sets the root configuration service to retrieve the scoped base configuration.
WithServiceErrorHandler sets the error handler on the Service object.
WithVaryBy allows to set a custom key producer.

# Variables

DefaultDeniedHandler defines the service wide denied handler.

# Structs

OptionFactories allows to register multiple OptionFactoryFunc identified by their names.
ScopedConfig scoped based configuration and should not be embedded into your own types.
Service creates a middleware that facilitates using a Limiter to limit HTTP requests.
VaryBy defines the criteria to use to group requests.

# Interfaces

VaryByer is called for each request to generate a key for the limiter.

# Type aliases

Option can be used as an argument in NewService to configure it with different settings.
OptionFactoryFunc a closure around a scoped configuration to figure out which options should be returned depending on the scope brought to you during a request.