Documentation ¶
Index ¶
- Variables
- type Settings
- func (m *Settings) Clone() proto.Message
- func (*Settings) Descriptor() ([]byte, []int)deprecated
- func (m *Settings) Equal(that interface{}) bool
- func (x *Settings) GetDefaultLimit() *TokenBucket
- func (x *Settings) GetEnableXRatelimitHeaders() *wrapperspb.BoolValue
- func (x *Settings) GetLocalRateLimitPerDownstreamConnection() *wrapperspb.BoolValue
- func (m *Settings) Hash(hasher hash.Hash64) (uint64, error)deprecated
- func (m *Settings) HashUnique(hasher hash.Hash64) (uint64, error)
- func (*Settings) ProtoMessage()
- func (x *Settings) ProtoReflect() protoreflect.Message
- func (x *Settings) Reset()
- func (x *Settings) String() string
- type TokenBucket
- func (m *TokenBucket) Clone() proto.Message
- func (*TokenBucket) Descriptor() ([]byte, []int)deprecated
- func (m *TokenBucket) Equal(that interface{}) bool
- func (x *TokenBucket) GetFillInterval() *durationpb.Duration
- func (x *TokenBucket) GetMaxTokens() uint32
- func (x *TokenBucket) GetTokensPerFill() *wrapperspb.UInt32Value
- func (m *TokenBucket) Hash(hasher hash.Hash64) (uint64, error)deprecated
- func (m *TokenBucket) HashUnique(hasher hash.Hash64) (uint64, error)
- func (*TokenBucket) ProtoMessage()
- func (x *TokenBucket) ProtoReflect() protoreflect.Message
- func (x *TokenBucket) Reset()
- func (x *TokenBucket) String() string
Constants ¶
This section is empty.
Variables ¶
var File_github_com_solo_io_gloo_projects_gloo_api_v1_options_local_ratelimit_local_ratelimit_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Settings ¶
type Settings struct { // The token bucket configuration to use for rate limiting requests. // These options provide the ability to locally rate limit the connections in envoy. 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. // This default limit can be overridden in the vHost or route options.localRatelimit DefaultLimit *TokenBucket `protobuf:"bytes,1,opt,name=default_limit,json=defaultLimit,proto3" json:"default_limit,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. // This setting applies to all token buckets in the vHost and route as well. // Defaults to false LocalRateLimitPerDownstreamConnection *wrapperspb.BoolValue `` /* 180-byte string literal not displayed */ // Set this to true to return Envoy's X-RateLimit headers to the downstream. // reference docs here: https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/common/ratelimit/v3/ratelimit.proto#envoy-v3-api-enum-extensions-common-ratelimit-v3-xratelimitheadersrfcversion // This setting applies at the vHost and route local rate limit as well // Defaults to false EnableXRatelimitHeaders *wrapperspb.BoolValue `` /* 134-byte string literal not displayed */ // contains filtered or unexported fields }
The Local Rate Limit settings define the default local rate limit token bucket to apply as well as other configurations
func (*Settings) Descriptor
deprecated
func (*Settings) GetDefaultLimit ¶
func (x *Settings) GetDefaultLimit() *TokenBucket
func (*Settings) GetEnableXRatelimitHeaders ¶
func (x *Settings) GetEnableXRatelimitHeaders() *wrapperspb.BoolValue
func (*Settings) GetLocalRateLimitPerDownstreamConnection ¶
func (x *Settings) GetLocalRateLimitPerDownstreamConnection() *wrapperspb.BoolValue
func (*Settings) HashUnique ¶
HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.
func (*Settings) ProtoMessage ¶
func (*Settings) ProtoMessage()
func (*Settings) ProtoReflect ¶
func (x *Settings) ProtoReflect() protoreflect.Message
type TokenBucket ¶
type TokenBucket struct { // The maximum tokens that the bucket can hold. This is also the number of tokens that the bucket initially contains. // Must be greater than or equal to one. MaxTokens uint32 `protobuf:"varint,1,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"` // The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token. // Must be greater than zero. TokensPerFill *wrapperspb.UInt32Value `protobuf:"bytes,2,opt,name=tokens_per_fill,json=tokensPerFill,proto3" json:"tokens_per_fill,omitempty"` // The fill interval that tokens are added to the bucket. During each fill interval tokens_per_fill are added to the bucket. // The bucket will never contain more than max_tokens tokens. // The fill_interval must be >= 50ms and defaults to 1 second. FillInterval *durationpb.Duration `protobuf:"bytes,3,opt,name=fill_interval,json=fillInterval,proto3" json:"fill_interval,omitempty"` // contains filtered or unexported fields }
Configures the token bucket, used for rate limiting. Ref. https://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/network_filters/local_rate_limit_filter
func (*TokenBucket) Descriptor
deprecated
func (*TokenBucket) Descriptor() ([]byte, []int)
Deprecated: Use TokenBucket.ProtoReflect.Descriptor instead.
func (*TokenBucket) GetFillInterval ¶
func (x *TokenBucket) GetFillInterval() *durationpb.Duration
func (*TokenBucket) GetMaxTokens ¶
func (x *TokenBucket) GetMaxTokens() uint32
func (*TokenBucket) GetTokensPerFill ¶
func (x *TokenBucket) GetTokensPerFill() *wrapperspb.UInt32Value
func (*TokenBucket) Hash
deprecated
func (m *TokenBucket) Hash(hasher hash.Hash64) (uint64, error)
Hash function
Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.
func (*TokenBucket) HashUnique ¶
func (m *TokenBucket) HashUnique(hasher hash.Hash64) (uint64, error)
HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.
func (*TokenBucket) ProtoMessage ¶
func (*TokenBucket) ProtoMessage()
func (*TokenBucket) ProtoReflect ¶
func (x *TokenBucket) ProtoReflect() protoreflect.Message
func (*TokenBucket) Reset ¶
func (x *TokenBucket) Reset()
func (*TokenBucket) String ¶
func (x *TokenBucket) String() string