Documentation
¶
Index ¶
- Variables
- type LocalRateLimit
- func (x *LocalRateLimit) ClearAlwaysConsumeDefaultTokenBucket()
- func (x *LocalRateLimit) ClearFilterEnabled()
- func (x *LocalRateLimit) ClearFilterEnforced()
- func (x *LocalRateLimit) ClearLocalClusterRateLimit()
- func (x *LocalRateLimit) ClearMaxDynamicDescriptors()
- func (x *LocalRateLimit) ClearStatus()
- func (x *LocalRateLimit) ClearTokenBucket()
- func (x *LocalRateLimit) GetAlwaysConsumeDefaultTokenBucket() *wrapperspb.BoolValue
- func (x *LocalRateLimit) GetDescriptors() []*v32.LocalRateLimitDescriptor
- func (x *LocalRateLimit) GetEnableXRatelimitHeaders() v32.XRateLimitHeadersRFCVersion
- func (x *LocalRateLimit) GetFilterEnabled() *v31.RuntimeFractionalPercent
- func (x *LocalRateLimit) GetFilterEnforced() *v31.RuntimeFractionalPercent
- func (x *LocalRateLimit) GetLocalClusterRateLimit() *v32.LocalClusterRateLimit
- func (x *LocalRateLimit) GetLocalRateLimitPerDownstreamConnection() bool
- func (x *LocalRateLimit) GetMaxDynamicDescriptors() *wrapperspb.UInt32Value
- func (x *LocalRateLimit) GetRateLimitedAsResourceExhausted() bool
- func (x *LocalRateLimit) GetRateLimits() []*v33.RateLimit
- func (x *LocalRateLimit) GetRequestHeadersToAddWhenNotEnforced() []*v31.HeaderValueOption
- func (x *LocalRateLimit) GetResponseHeadersToAdd() []*v31.HeaderValueOption
- func (x *LocalRateLimit) GetStage() uint32
- func (x *LocalRateLimit) GetStatPrefix() string
- func (x *LocalRateLimit) GetStatus() *v3.HttpStatus
- func (x *LocalRateLimit) GetTokenBucket() *v3.TokenBucket
- func (x *LocalRateLimit) GetVhRateLimits() v32.VhRateLimitsOptions
- func (x *LocalRateLimit) HasAlwaysConsumeDefaultTokenBucket() bool
- func (x *LocalRateLimit) HasFilterEnabled() bool
- func (x *LocalRateLimit) HasFilterEnforced() bool
- func (x *LocalRateLimit) HasLocalClusterRateLimit() bool
- func (x *LocalRateLimit) HasMaxDynamicDescriptors() bool
- func (x *LocalRateLimit) HasStatus() bool
- func (x *LocalRateLimit) HasTokenBucket() bool
- func (*LocalRateLimit) ProtoMessage()
- func (x *LocalRateLimit) ProtoReflect() protoreflect.Message
- func (x *LocalRateLimit) Reset()
- func (x *LocalRateLimit) SetAlwaysConsumeDefaultTokenBucket(v *wrapperspb.BoolValue)
- func (x *LocalRateLimit) SetDescriptors(v []*v32.LocalRateLimitDescriptor)
- func (x *LocalRateLimit) SetEnableXRatelimitHeaders(v v32.XRateLimitHeadersRFCVersion)
- func (x *LocalRateLimit) SetFilterEnabled(v *v31.RuntimeFractionalPercent)
- func (x *LocalRateLimit) SetFilterEnforced(v *v31.RuntimeFractionalPercent)
- func (x *LocalRateLimit) SetLocalClusterRateLimit(v *v32.LocalClusterRateLimit)
- func (x *LocalRateLimit) SetLocalRateLimitPerDownstreamConnection(v bool)
- func (x *LocalRateLimit) SetMaxDynamicDescriptors(v *wrapperspb.UInt32Value)
- func (x *LocalRateLimit) SetRateLimitedAsResourceExhausted(v bool)
- func (x *LocalRateLimit) SetRateLimits(v []*v33.RateLimit)
- func (x *LocalRateLimit) SetRequestHeadersToAddWhenNotEnforced(v []*v31.HeaderValueOption)
- func (x *LocalRateLimit) SetResponseHeadersToAdd(v []*v31.HeaderValueOption)
- func (x *LocalRateLimit) SetStage(v uint32)
- func (x *LocalRateLimit) SetStatPrefix(v string)
- func (x *LocalRateLimit) SetStatus(v *v3.HttpStatus)
- func (x *LocalRateLimit) SetTokenBucket(v *v3.TokenBucket)
- func (x *LocalRateLimit) SetVhRateLimits(v v32.VhRateLimitsOptions)
- func (x *LocalRateLimit) String() string
- type LocalRateLimit_builder
Constants ¶
This section is empty.
Variables ¶
View Source
var File_envoy_extensions_filters_http_local_ratelimit_v3_local_rate_limit_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type LocalRateLimit ¶
type LocalRateLimit struct {
// The human readable prefix to use when emitting stats.
StatPrefix string `protobuf:"bytes,1,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
// This field allows for a custom HTTP response status code to the downstream client when
// the request has been rate limited.
// Defaults to 429 (TooManyRequests).
//
// .. note::
//
// If this is set to < 400, 429 will be used instead.
Status *v3.HttpStatus `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
// The token bucket configuration to use for rate limiting requests that are processed by this
// filter. Each request processed by the filter consumes a single token. If the token is available,
// the request will be allowed. If no tokens are available, the request will receive the configured
// rate limit status.
//
// .. note::
//
// It's fine for the token bucket to be unset for the global configuration since the rate limit
// can be applied at a the virtual host or route level. Thus, the token bucket must be set
// for the per route configuration otherwise the config will be rejected.
//
// .. note::
//
// When using per route configuration, the bucket becomes unique to that route.
//
// .. note::
//
// In the current implementation the token bucket's :ref:`fill_interval
// <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be >= 50ms to avoid too aggressive
// refills.
TokenBucket *v3.TokenBucket `protobuf:"bytes,3,opt,name=token_bucket,json=tokenBucket,proto3" json:"token_bucket,omitempty"`
// If set, this will enable -- but not necessarily enforce -- the rate limit for the given
// fraction of requests.
// Defaults to 0% of requests for safety.
FilterEnabled *v31.RuntimeFractionalPercent `protobuf:"bytes,4,opt,name=filter_enabled,json=filterEnabled,proto3" json:"filter_enabled,omitempty"`
// If set, this will enforce the rate limit decisions for the given fraction of requests.
//
// Note: this only applies to the fraction of enabled requests.
//
// Defaults to 0% of requests for safety.
FilterEnforced *v31.RuntimeFractionalPercent `protobuf:"bytes,5,opt,name=filter_enforced,json=filterEnforced,proto3" json:"filter_enforced,omitempty"`
// Specifies a list of HTTP headers that should be added to each request that
// has been rate limited and is also forwarded upstream. This can only occur when the
// filter is enabled but not enforced.
RequestHeadersToAddWhenNotEnforced []*v31.HeaderValueOption `` /* 174-byte string literal not displayed */
// Specifies a list of HTTP headers that should be added to each response for requests that
// have been rate limited. This occurs when the filter is enabled and fully enforced.
ResponseHeadersToAdd []*v31.HeaderValueOption `protobuf:"bytes,6,rep,name=response_headers_to_add,json=responseHeadersToAdd,proto3" json:"response_headers_to_add,omitempty"`
// The rate limit descriptor list to use in the local rate limit to override
// on. The rate limit descriptor is selected by the first full match from the
// request descriptors.
//
// Example on how to use :ref:`this <config_http_filters_local_rate_limit_descriptors>`.
//
// .. note::
//
// In the current implementation the descriptor's token bucket :ref:`fill_interval
// <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be a multiple
// global :ref:`token bucket's<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.token_bucket>` fill interval.
//
// The descriptors must match verbatim for rate limiting to apply. There is no partial
// match by a subset of descriptor entries in the current implementation.
Descriptors []*v32.LocalRateLimitDescriptor `protobuf:"bytes,8,rep,name=descriptors,proto3" json:"descriptors,omitempty"`
// Specifies the rate limit configurations to be applied with the same
// stage number. If not set, the default stage number is 0.
//
// .. note::
//
// The filter supports a range of 0 - 10 inclusively for stage numbers.
Stage uint32 `protobuf:"varint,9,opt,name=stage,proto3" json:"stage,omitempty"`
// Specifies the scope of the rate limiter's token bucket.
// If set to false, the token bucket is shared across all worker threads,
// thus the rate limits are applied per Envoy process.
// If set to true, a token bucket is allocated for each connection.
// Thus the rate limits are applied per connection thereby allowing
// one to rate limit requests on a per connection basis.
// If unspecified, the default value is false.
LocalRateLimitPerDownstreamConnection bool `` /* 182-byte string literal not displayed */
// Enables the local cluster level rate limiting, iff this is set explicitly. For example,
// given an Envoy gateway that contains N Envoy instances and a rate limit rule X tokens
// per second. If this is set, the total rate limit of whole gateway will always be X tokens
// per second regardless of how N changes. If this is not set, the total rate limit of whole
// gateway will be N * X tokens per second.
//
// .. note::
//
// This should never be set if the “local_rate_limit_per_downstream_connection“ is set to
// true. Because if per connection rate limiting is enabled, we assume that the token buckets
// should never be shared across Envoy instances.
//
// .. note::
//
// This only works when the :ref:`local cluster name
// <envoy_v3_api_field_config.bootstrap.v3.ClusterManager.local_cluster_name>` is set and
// the related cluster is defined in the bootstrap configuration.
LocalClusterRateLimit *v32.LocalClusterRateLimit `` /* 129-byte string literal not displayed */
// Defines the standard version to use for X-RateLimit headers emitted by the filter.
//
// - “X-RateLimit-Limit“ - indicates the request-quota associated to the
// client in the current time-window followed by the description of the
// quota policy.
// - “X-RateLimit-Remaining“ - indicates the remaining requests in the
// current time-window.
// - “X-RateLimit-Reset“ - indicates the number of seconds until reset of
// the current time-window.
//
// In case rate limiting policy specifies more then one time window, the values
// above represent the window that is closest to reaching its limit.
//
// For more information about the headers specification see selected version of
// the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
//
// Disabled by default.
EnableXRatelimitHeaders v32.XRateLimitHeadersRFCVersion `` /* 206-byte string literal not displayed */
// Specifies if the local rate limit filter should include the virtual host rate limits.
VhRateLimits v32.VhRateLimitsOptions `` /* 163-byte string literal not displayed */
// Specifies if default token bucket should be always consumed.
// If set to false, default token bucket will only be consumed when there is
// no matching descriptor. If set to true, default token bucket will always
// be consumed. Default is true.
AlwaysConsumeDefaultTokenBucket *wrapperspb.BoolValue `` /* 161-byte string literal not displayed */
// Specifies whether a “RESOURCE_EXHAUSTED“ gRPC code must be returned instead
// of the default “UNAVAILABLE“ gRPC code for a rate limited gRPC call. The
// HTTP code will be 200 for a gRPC response.
RateLimitedAsResourceExhausted bool `` /* 159-byte string literal not displayed */
// Rate limit configuration that is used to generate a list of descriptor entries based on
// the request context. The generated entries will be used to find one or multiple matched rate
// limit rule from the “descriptors“.
// If this is set, then
// :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
// :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
// will be ignored.
//
// .. note::
//
// Not all configuration fields of
// :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
// Following fields are not supported:
//
// 1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
// 2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
// 3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
// 4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
RateLimits []*v33.RateLimit `protobuf:"bytes,17,rep,name=rate_limits,json=rateLimits,proto3" json:"rate_limits,omitempty"`
// Specifies the max dynamic descriptors kept in the cache for a particular wildcard descriptor
// configured in the global :ref:`descriptors<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.descriptors>`.
// Wildcard descriptor means descriptor has one or more entries with just key and value omitted. For example if user has configured two descriptors
// with blank value entries, then max dynamic descriptors stored in the LRU cache will be 2 * max_dynamic_descriptors.
// Actual number of dynamic descriptors will depend on the cardinality of unique values received from the http request for the omitted
// values.
// Minimum is 1. Default is 20.
MaxDynamicDescriptors *wrapperspb.UInt32Value `` /* 127-byte string literal not displayed */
// contains filtered or unexported fields
}
[#next-free-field: 19]
func (*LocalRateLimit) ClearAlwaysConsumeDefaultTokenBucket ¶
func (x *LocalRateLimit) ClearAlwaysConsumeDefaultTokenBucket()
func (*LocalRateLimit) ClearFilterEnabled ¶
func (x *LocalRateLimit) ClearFilterEnabled()
func (*LocalRateLimit) ClearFilterEnforced ¶
func (x *LocalRateLimit) ClearFilterEnforced()
func (*LocalRateLimit) ClearLocalClusterRateLimit ¶
func (x *LocalRateLimit) ClearLocalClusterRateLimit()
func (*LocalRateLimit) ClearMaxDynamicDescriptors ¶
func (x *LocalRateLimit) ClearMaxDynamicDescriptors()
func (*LocalRateLimit) ClearStatus ¶
func (x *LocalRateLimit) ClearStatus()
func (*LocalRateLimit) ClearTokenBucket ¶
func (x *LocalRateLimit) ClearTokenBucket()
func (*LocalRateLimit) GetAlwaysConsumeDefaultTokenBucket ¶
func (x *LocalRateLimit) GetAlwaysConsumeDefaultTokenBucket() *wrapperspb.BoolValue
func (*LocalRateLimit) GetDescriptors ¶
func (x *LocalRateLimit) GetDescriptors() []*v32.LocalRateLimitDescriptor
func (*LocalRateLimit) GetEnableXRatelimitHeaders ¶
func (x *LocalRateLimit) GetEnableXRatelimitHeaders() v32.XRateLimitHeadersRFCVersion
func (*LocalRateLimit) GetFilterEnabled ¶
func (x *LocalRateLimit) GetFilterEnabled() *v31.RuntimeFractionalPercent
func (*LocalRateLimit) GetFilterEnforced ¶
func (x *LocalRateLimit) GetFilterEnforced() *v31.RuntimeFractionalPercent
func (*LocalRateLimit) GetLocalClusterRateLimit ¶
func (x *LocalRateLimit) GetLocalClusterRateLimit() *v32.LocalClusterRateLimit
func (*LocalRateLimit) GetLocalRateLimitPerDownstreamConnection ¶
func (x *LocalRateLimit) GetLocalRateLimitPerDownstreamConnection() bool
func (*LocalRateLimit) GetMaxDynamicDescriptors ¶
func (x *LocalRateLimit) GetMaxDynamicDescriptors() *wrapperspb.UInt32Value
func (*LocalRateLimit) GetRateLimitedAsResourceExhausted ¶
func (x *LocalRateLimit) GetRateLimitedAsResourceExhausted() bool
func (*LocalRateLimit) GetRateLimits ¶
func (x *LocalRateLimit) GetRateLimits() []*v33.RateLimit
func (*LocalRateLimit) GetRequestHeadersToAddWhenNotEnforced ¶
func (x *LocalRateLimit) GetRequestHeadersToAddWhenNotEnforced() []*v31.HeaderValueOption
func (*LocalRateLimit) GetResponseHeadersToAdd ¶
func (x *LocalRateLimit) GetResponseHeadersToAdd() []*v31.HeaderValueOption
func (*LocalRateLimit) GetStage ¶
func (x *LocalRateLimit) GetStage() uint32
func (*LocalRateLimit) GetStatPrefix ¶
func (x *LocalRateLimit) GetStatPrefix() string
func (*LocalRateLimit) GetStatus ¶
func (x *LocalRateLimit) GetStatus() *v3.HttpStatus
func (*LocalRateLimit) GetTokenBucket ¶
func (x *LocalRateLimit) GetTokenBucket() *v3.TokenBucket
func (*LocalRateLimit) GetVhRateLimits ¶
func (x *LocalRateLimit) GetVhRateLimits() v32.VhRateLimitsOptions
func (*LocalRateLimit) HasAlwaysConsumeDefaultTokenBucket ¶
func (x *LocalRateLimit) HasAlwaysConsumeDefaultTokenBucket() bool
func (*LocalRateLimit) HasFilterEnabled ¶
func (x *LocalRateLimit) HasFilterEnabled() bool
func (*LocalRateLimit) HasFilterEnforced ¶
func (x *LocalRateLimit) HasFilterEnforced() bool
func (*LocalRateLimit) HasLocalClusterRateLimit ¶
func (x *LocalRateLimit) HasLocalClusterRateLimit() bool
func (*LocalRateLimit) HasMaxDynamicDescriptors ¶
func (x *LocalRateLimit) HasMaxDynamicDescriptors() bool
func (*LocalRateLimit) HasStatus ¶
func (x *LocalRateLimit) HasStatus() bool
func (*LocalRateLimit) HasTokenBucket ¶
func (x *LocalRateLimit) HasTokenBucket() bool
func (*LocalRateLimit) ProtoMessage ¶
func (*LocalRateLimit) ProtoMessage()
func (*LocalRateLimit) ProtoReflect ¶
func (x *LocalRateLimit) ProtoReflect() protoreflect.Message
func (*LocalRateLimit) Reset ¶
func (x *LocalRateLimit) Reset()
func (*LocalRateLimit) SetAlwaysConsumeDefaultTokenBucket ¶
func (x *LocalRateLimit) SetAlwaysConsumeDefaultTokenBucket(v *wrapperspb.BoolValue)
func (*LocalRateLimit) SetDescriptors ¶
func (x *LocalRateLimit) SetDescriptors(v []*v32.LocalRateLimitDescriptor)
func (*LocalRateLimit) SetEnableXRatelimitHeaders ¶
func (x *LocalRateLimit) SetEnableXRatelimitHeaders(v v32.XRateLimitHeadersRFCVersion)
func (*LocalRateLimit) SetFilterEnabled ¶
func (x *LocalRateLimit) SetFilterEnabled(v *v31.RuntimeFractionalPercent)
func (*LocalRateLimit) SetFilterEnforced ¶
func (x *LocalRateLimit) SetFilterEnforced(v *v31.RuntimeFractionalPercent)
func (*LocalRateLimit) SetLocalClusterRateLimit ¶
func (x *LocalRateLimit) SetLocalClusterRateLimit(v *v32.LocalClusterRateLimit)
func (*LocalRateLimit) SetLocalRateLimitPerDownstreamConnection ¶
func (x *LocalRateLimit) SetLocalRateLimitPerDownstreamConnection(v bool)
func (*LocalRateLimit) SetMaxDynamicDescriptors ¶
func (x *LocalRateLimit) SetMaxDynamicDescriptors(v *wrapperspb.UInt32Value)
func (*LocalRateLimit) SetRateLimitedAsResourceExhausted ¶
func (x *LocalRateLimit) SetRateLimitedAsResourceExhausted(v bool)
func (*LocalRateLimit) SetRateLimits ¶
func (x *LocalRateLimit) SetRateLimits(v []*v33.RateLimit)
func (*LocalRateLimit) SetRequestHeadersToAddWhenNotEnforced ¶
func (x *LocalRateLimit) SetRequestHeadersToAddWhenNotEnforced(v []*v31.HeaderValueOption)
func (*LocalRateLimit) SetResponseHeadersToAdd ¶
func (x *LocalRateLimit) SetResponseHeadersToAdd(v []*v31.HeaderValueOption)
func (*LocalRateLimit) SetStage ¶
func (x *LocalRateLimit) SetStage(v uint32)
func (*LocalRateLimit) SetStatPrefix ¶
func (x *LocalRateLimit) SetStatPrefix(v string)
func (*LocalRateLimit) SetStatus ¶
func (x *LocalRateLimit) SetStatus(v *v3.HttpStatus)
func (*LocalRateLimit) SetTokenBucket ¶
func (x *LocalRateLimit) SetTokenBucket(v *v3.TokenBucket)
func (*LocalRateLimit) SetVhRateLimits ¶
func (x *LocalRateLimit) SetVhRateLimits(v v32.VhRateLimitsOptions)
func (*LocalRateLimit) String ¶
func (x *LocalRateLimit) String() string
type LocalRateLimit_builder ¶
type LocalRateLimit_builder struct {
// The human readable prefix to use when emitting stats.
StatPrefix string
// This field allows for a custom HTTP response status code to the downstream client when
// the request has been rate limited.
// Defaults to 429 (TooManyRequests).
//
// .. note::
//
// If this is set to < 400, 429 will be used instead.
Status *v3.HttpStatus
// The token bucket configuration to use for rate limiting requests that are processed by this
// filter. Each request processed by the filter consumes a single token. If the token is available,
// the request will be allowed. If no tokens are available, the request will receive the configured
// rate limit status.
//
// .. note::
//
// It's fine for the token bucket to be unset for the global configuration since the rate limit
// can be applied at a the virtual host or route level. Thus, the token bucket must be set
// for the per route configuration otherwise the config will be rejected.
//
// .. note::
//
// When using per route configuration, the bucket becomes unique to that route.
//
// .. note::
//
// In the current implementation the token bucket's :ref:`fill_interval
// <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be >= 50ms to avoid too aggressive
// refills.
TokenBucket *v3.TokenBucket
// If set, this will enable -- but not necessarily enforce -- the rate limit for the given
// fraction of requests.
// Defaults to 0% of requests for safety.
FilterEnabled *v31.RuntimeFractionalPercent
// If set, this will enforce the rate limit decisions for the given fraction of requests.
//
// Note: this only applies to the fraction of enabled requests.
//
// Defaults to 0% of requests for safety.
FilterEnforced *v31.RuntimeFractionalPercent
// Specifies a list of HTTP headers that should be added to each request that
// has been rate limited and is also forwarded upstream. This can only occur when the
// filter is enabled but not enforced.
RequestHeadersToAddWhenNotEnforced []*v31.HeaderValueOption
// Specifies a list of HTTP headers that should be added to each response for requests that
// have been rate limited. This occurs when the filter is enabled and fully enforced.
ResponseHeadersToAdd []*v31.HeaderValueOption
// The rate limit descriptor list to use in the local rate limit to override
// on. The rate limit descriptor is selected by the first full match from the
// request descriptors.
//
// Example on how to use :ref:`this <config_http_filters_local_rate_limit_descriptors>`.
//
// .. note::
//
// In the current implementation the descriptor's token bucket :ref:`fill_interval
// <envoy_v3_api_field_type.v3.TokenBucket.fill_interval>` must be a multiple
// global :ref:`token bucket's<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.token_bucket>` fill interval.
//
// The descriptors must match verbatim for rate limiting to apply. There is no partial
// match by a subset of descriptor entries in the current implementation.
Descriptors []*v32.LocalRateLimitDescriptor
// Specifies the rate limit configurations to be applied with the same
// stage number. If not set, the default stage number is 0.
//
// .. note::
//
// The filter supports a range of 0 - 10 inclusively for stage numbers.
Stage uint32
// Specifies the scope of the rate limiter's token bucket.
// If set to false, the token bucket is shared across all worker threads,
// thus the rate limits are applied per Envoy process.
// If set to true, a token bucket is allocated for each connection.
// Thus the rate limits are applied per connection thereby allowing
// one to rate limit requests on a per connection basis.
// If unspecified, the default value is false.
LocalRateLimitPerDownstreamConnection bool
// Enables the local cluster level rate limiting, iff this is set explicitly. For example,
// given an Envoy gateway that contains N Envoy instances and a rate limit rule X tokens
// per second. If this is set, the total rate limit of whole gateway will always be X tokens
// per second regardless of how N changes. If this is not set, the total rate limit of whole
// gateway will be N * X tokens per second.
//
// .. note::
//
// This should never be set if the “local_rate_limit_per_downstream_connection“ is set to
// true. Because if per connection rate limiting is enabled, we assume that the token buckets
// should never be shared across Envoy instances.
//
// .. note::
//
// This only works when the :ref:`local cluster name
// <envoy_v3_api_field_config.bootstrap.v3.ClusterManager.local_cluster_name>` is set and
// the related cluster is defined in the bootstrap configuration.
LocalClusterRateLimit *v32.LocalClusterRateLimit
// Defines the standard version to use for X-RateLimit headers emitted by the filter.
//
// - “X-RateLimit-Limit“ - indicates the request-quota associated to the
// client in the current time-window followed by the description of the
// quota policy.
// - “X-RateLimit-Remaining“ - indicates the remaining requests in the
// current time-window.
// - “X-RateLimit-Reset“ - indicates the number of seconds until reset of
// the current time-window.
//
// In case rate limiting policy specifies more then one time window, the values
// above represent the window that is closest to reaching its limit.
//
// For more information about the headers specification see selected version of
// the `draft RFC <https://tools.ietf.org/id/draft-polli-ratelimit-headers-03.html>`_.
//
// Disabled by default.
EnableXRatelimitHeaders v32.XRateLimitHeadersRFCVersion
// Specifies if the local rate limit filter should include the virtual host rate limits.
VhRateLimits v32.VhRateLimitsOptions
// Specifies if default token bucket should be always consumed.
// If set to false, default token bucket will only be consumed when there is
// no matching descriptor. If set to true, default token bucket will always
// be consumed. Default is true.
AlwaysConsumeDefaultTokenBucket *wrapperspb.BoolValue
// Specifies whether a “RESOURCE_EXHAUSTED“ gRPC code must be returned instead
// of the default “UNAVAILABLE“ gRPC code for a rate limited gRPC call. The
// HTTP code will be 200 for a gRPC response.
RateLimitedAsResourceExhausted bool
// Rate limit configuration that is used to generate a list of descriptor entries based on
// the request context. The generated entries will be used to find one or multiple matched rate
// limit rule from the “descriptors“.
// If this is set, then
// :ref:`VirtualHost.rate_limits<envoy_v3_api_field_config.route.v3.VirtualHost.rate_limits>` or
// :ref:`RouteAction.rate_limits<envoy_v3_api_field_config.route.v3.RouteAction.rate_limits>` fields
// will be ignored.
//
// .. note::
//
// Not all configuration fields of
// :ref:`rate limit config <envoy_v3_api_msg_config.route.v3.RateLimit>` is supported at here.
// Following fields are not supported:
//
// 1. :ref:`rate limit stage <envoy_v3_api_field_config.route.v3.RateLimit.stage>`.
// 2. :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>`.
// 3. :ref:`disable_key <envoy_v3_api_field_config.route.v3.RateLimit.disable_key>`.
// 4. :ref:`override limit <envoy_v3_api_field_config.route.v3.RateLimit.limit>`.
RateLimits []*v33.RateLimit
// Specifies the max dynamic descriptors kept in the cache for a particular wildcard descriptor
// configured in the global :ref:`descriptors<envoy_v3_api_field_extensions.filters.http.local_ratelimit.v3.LocalRateLimit.descriptors>`.
// Wildcard descriptor means descriptor has one or more entries with just key and value omitted. For example if user has configured two descriptors
// with blank value entries, then max dynamic descriptors stored in the LRU cache will be 2 * max_dynamic_descriptors.
// Actual number of dynamic descriptors will depend on the cardinality of unique values received from the http request for the omitted
// values.
// Minimum is 1. Default is 20.
MaxDynamicDescriptors *wrapperspb.UInt32Value
// contains filtered or unexported fields
}
func (LocalRateLimit_builder) Build ¶
func (b0 LocalRateLimit_builder) Build() *LocalRateLimit
Source Files
¶
- local_rate_limit.pb.go
Click to show internal directories.
Click to hide internal directories.