Documentation ¶
Index ¶
- Variables
- type LocalRateLimit
- func (*LocalRateLimit) Descriptor() ([]byte, []int)deprecated
- func (x *LocalRateLimit) GetFilterEnabled() *v31.RuntimeFractionalPercent
- func (x *LocalRateLimit) GetFilterEnforced() *v31.RuntimeFractionalPercent
- func (x *LocalRateLimit) GetResponseHeadersToAdd() []*v31.HeaderValueOption
- func (x *LocalRateLimit) GetStatPrefix() string
- func (x *LocalRateLimit) GetStatus() *v3.HttpStatus
- func (x *LocalRateLimit) GetTokenBucket() *v3.TokenBucket
- func (*LocalRateLimit) ProtoMessage()
- func (x *LocalRateLimit) ProtoReflect() protoreflect.Message
- func (x *LocalRateLimit) Reset()
- func (x *LocalRateLimit) String() string
- func (m *LocalRateLimit) Validate() error
- type LocalRateLimitValidationError
- func (e LocalRateLimitValidationError) Cause() error
- func (e LocalRateLimitValidationError) Error() string
- func (e LocalRateLimitValidationError) ErrorName() string
- func (e LocalRateLimitValidationError) Field() string
- func (e LocalRateLimitValidationError) Key() bool
- func (e LocalRateLimitValidationError) Reason() string
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_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 response for requests that // have been rate limited. ResponseHeadersToAdd []*v31.HeaderValueOption `protobuf:"bytes,6,rep,name=response_headers_to_add,json=responseHeadersToAdd,proto3" json:"response_headers_to_add,omitempty"` // contains filtered or unexported fields }
[#next-free-field: 7]
func (*LocalRateLimit) Descriptor
deprecated
func (*LocalRateLimit) Descriptor() ([]byte, []int)
Deprecated: Use LocalRateLimit.ProtoReflect.Descriptor instead.
func (*LocalRateLimit) GetFilterEnabled ¶
func (x *LocalRateLimit) GetFilterEnabled() *v31.RuntimeFractionalPercent
func (*LocalRateLimit) GetFilterEnforced ¶
func (x *LocalRateLimit) GetFilterEnforced() *v31.RuntimeFractionalPercent
func (*LocalRateLimit) GetResponseHeadersToAdd ¶
func (x *LocalRateLimit) GetResponseHeadersToAdd() []*v31.HeaderValueOption
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) ProtoMessage ¶
func (*LocalRateLimit) ProtoMessage()
func (*LocalRateLimit) ProtoReflect ¶
func (x *LocalRateLimit) ProtoReflect() protoreflect.Message
func (*LocalRateLimit) Reset ¶
func (x *LocalRateLimit) Reset()
func (*LocalRateLimit) String ¶
func (x *LocalRateLimit) String() string
func (*LocalRateLimit) Validate ¶
func (m *LocalRateLimit) Validate() error
Validate checks the field values on LocalRateLimit with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type LocalRateLimitValidationError ¶
type LocalRateLimitValidationError struct {
// contains filtered or unexported fields
}
LocalRateLimitValidationError is the validation error returned by LocalRateLimit.Validate if the designated constraints aren't met.
func (LocalRateLimitValidationError) Cause ¶
func (e LocalRateLimitValidationError) Cause() error
Cause function returns cause value.
func (LocalRateLimitValidationError) Error ¶
func (e LocalRateLimitValidationError) Error() string
Error satisfies the builtin error interface
func (LocalRateLimitValidationError) ErrorName ¶
func (e LocalRateLimitValidationError) ErrorName() string
ErrorName returns error name.
func (LocalRateLimitValidationError) Field ¶
func (e LocalRateLimitValidationError) Field() string
Field function returns field value.
func (LocalRateLimitValidationError) Key ¶
func (e LocalRateLimitValidationError) Key() bool
Key function returns key value.
func (LocalRateLimitValidationError) Reason ¶
func (e LocalRateLimitValidationError) Reason() string
Reason function returns reason value.
Click to show internal directories.
Click to hide internal directories.