Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertActions(ctx context.Context, actions []*solo_rl.Action) ([]*envoy_config_route_v3.RateLimit_Action, error)
- func GenerateEnvoyConfigForFilterWith(upstreamRef *core.ResourceRef, grpcService *ratelimit.GrpcService, ...) *envoyratelimit.RateLimit
- func GenerateEnvoyHttpFilterConfig(serverSettings *ratelimit.Settings) *envoy_extensions_filters_http_ratelimit_v3.RateLimit
- func GetFilterStageForRateLimitStage(rateLimitStage uint32) plugins.FilterStage[plugins.WellKnownFilterStage]
- func GetRateLimitStageForServerSettings(serverSettings *ratelimit.Settings) uint32
- func NewPlugin() *plugin
Constants ¶
View Source
const ( ExtensionName = "rate_limit" CustomDomain = "custom" RequestType = "both" CustomStage = uint32(1) CustomStageBeforeAuth = uint32(3) )
View Source
const SetDescriptorValue = "solo.setDescriptor.uniqueValue"
special value for generic keys that signals the enterprise rate limit server to treat those descriptors differently (for the set-style rate-limit API)
Variables ¶
View Source
var ( // rate limiting should happen after auth DefaultFilterStage = plugins.DuringStage(plugins.RateLimitStage) // we may want to rate limit before executing the AuthN and AuthZ stages // notably, AuthZ still needs to occur after AuthN BeforeAuthStage = plugins.BeforeStage(plugins.AuthNStage) DefaultTimeout = prototime.DurationToProto(100 * time.Millisecond) ServerNotFound = func(usRef *core.ResourceRef) error { return eris.Errorf("ratelimit server upstream not found %s", usRef.String()) } )
Functions ¶
func ConvertActions ¶
func ConvertActions(ctx context.Context, actions []*solo_rl.Action) ([]*envoy_config_route_v3.RateLimit_Action, error)
ConvertActions generates Envoy RateLimit_Actions from the solo-apis API. It checks that all required fields are set.
func GenerateEnvoyConfigForFilterWith ¶
func GenerateEnvoyConfigForFilterWith( upstreamRef *core.ResourceRef, grpcService *ratelimit.GrpcService, domain string, stage uint32, timeout *duration.Duration, denyOnFail bool, enableXRatelimitHeaders bool, ) *envoyratelimit.RateLimit
func GenerateEnvoyHttpFilterConfig ¶ added in v1.9.25
func GenerateEnvoyHttpFilterConfig(serverSettings *ratelimit.Settings) *envoy_extensions_filters_http_ratelimit_v3.RateLimit
func GetFilterStageForRateLimitStage ¶ added in v1.9.25
func GetFilterStageForRateLimitStage(rateLimitStage uint32) plugins.FilterStage[plugins.WellKnownFilterStage]
func GetRateLimitStageForServerSettings ¶ added in v1.9.25
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.