Documentation ¶
Index ¶
- Variables
- type RateLimiter
- func (*RateLimiter) Descriptor() ([]byte, []int)deprecated
- func (x *RateLimiter) GetEnabled() bool
- func (x *RateLimiter) GetMemory() *RateLimiter_Memory
- func (x *RateLimiter) GetName() string
- func (x *RateLimiter) GetPeriod() int32
- func (x *RateLimiter) GetRedis() *RateLimiter_Redis
- func (x *RateLimiter) GetRetryAfter() int32
- func (x *RateLimiter) GetXRatelimitLimit() int32
- func (x *RateLimiter) GetXRatelimitRemaining() int32
- func (x *RateLimiter) GetXRatelimitReset() int32
- func (*RateLimiter) ProtoMessage()
- func (x *RateLimiter) ProtoReflect() protoreflect.Message
- func (x *RateLimiter) Reset()
- func (x *RateLimiter) String() string
- func (m *RateLimiter) Validate() error
- func (m *RateLimiter) ValidateAll() error
- type RateLimiterMultiError
- type RateLimiterValidationError
- func (e RateLimiterValidationError) Cause() error
- func (e RateLimiterValidationError) Error() string
- func (e RateLimiterValidationError) ErrorName() string
- func (e RateLimiterValidationError) Field() string
- func (e RateLimiterValidationError) Key() bool
- func (e RateLimiterValidationError) Reason() string
- type RateLimiter_Memory
- func (*RateLimiter_Memory) Descriptor() ([]byte, []int)deprecated
- func (x *RateLimiter_Memory) GetCleanupInterval() *durationpb.Duration
- func (x *RateLimiter_Memory) GetExpiration() *durationpb.Duration
- func (*RateLimiter_Memory) ProtoMessage()
- func (x *RateLimiter_Memory) ProtoReflect() protoreflect.Message
- func (x *RateLimiter_Memory) Reset()
- func (x *RateLimiter_Memory) String() string
- func (m *RateLimiter_Memory) Validate() error
- func (m *RateLimiter_Memory) ValidateAll() error
- type RateLimiter_MemoryMultiError
- type RateLimiter_MemoryValidationError
- func (e RateLimiter_MemoryValidationError) Cause() error
- func (e RateLimiter_MemoryValidationError) Error() string
- func (e RateLimiter_MemoryValidationError) ErrorName() string
- func (e RateLimiter_MemoryValidationError) Field() string
- func (e RateLimiter_MemoryValidationError) Key() bool
- func (e RateLimiter_MemoryValidationError) Reason() string
- type RateLimiter_Redis
- func (*RateLimiter_Redis) Descriptor() ([]byte, []int)deprecated
- func (x *RateLimiter_Redis) GetAddr() string
- func (x *RateLimiter_Redis) GetDb() int32
- func (x *RateLimiter_Redis) GetPassword() string
- func (x *RateLimiter_Redis) GetUsername() string
- func (*RateLimiter_Redis) ProtoMessage()
- func (x *RateLimiter_Redis) ProtoReflect() protoreflect.Message
- func (x *RateLimiter_Redis) Reset()
- func (x *RateLimiter_Redis) String() string
- func (m *RateLimiter_Redis) Validate() error
- func (m *RateLimiter_Redis) ValidateAll() error
- type RateLimiter_RedisMultiError
- type RateLimiter_RedisValidationError
- func (e RateLimiter_RedisValidationError) Cause() error
- func (e RateLimiter_RedisValidationError) Error() string
- func (e RateLimiter_RedisValidationError) ErrorName() string
- func (e RateLimiter_RedisValidationError) Field() string
- func (e RateLimiter_RedisValidationError) Key() bool
- func (e RateLimiter_RedisValidationError) Reason() string
Constants ¶
This section is empty.
Variables ¶
var File_middleware_ratelimit_v1_ratelimiter_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type RateLimiter ¶
type RateLimiter struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // rate limiter name, supported: bbr, memory, redis. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // The number of seconds in a rate limit window Period int32 `protobuf:"varint,3,opt,name=period,proto3" json:"period,omitempty"` // The number of requests allowed in a window of time XRatelimitLimit int32 `protobuf:"varint,5,opt,name=x_ratelimit_limit,proto3" json:"x_ratelimit_limit,omitempty"` // The number of requests that can still be made in the current window of time XRatelimitRemaining int32 `protobuf:"varint,6,opt,name=x_ratelimit_remaining,proto3" json:"x_ratelimit_remaining,omitempty"` // The number of seconds until the current rate limit window completely resets XRatelimitReset int32 `protobuf:"varint,7,opt,name=x_ratelimit_reset,proto3" json:"x_ratelimit_reset,omitempty"` // When rate limited, the number of seconds to wait before another request will be accepted RetryAfter int32 `protobuf:"varint,8,opt,name=retry_after,proto3" json:"retry_after,omitempty"` Memory *RateLimiter_Memory `protobuf:"bytes,101,opt,name=memory,proto3" json:"memory,omitempty"` Redis *RateLimiter_Redis `protobuf:"bytes,102,opt,name=redis,proto3" json:"redis,omitempty"` // contains filtered or unexported fields }
Rate limiter
func (*RateLimiter) Descriptor
deprecated
func (*RateLimiter) Descriptor() ([]byte, []int)
Deprecated: Use RateLimiter.ProtoReflect.Descriptor instead.
func (*RateLimiter) GetEnabled ¶
func (x *RateLimiter) GetEnabled() bool
func (*RateLimiter) GetMemory ¶
func (x *RateLimiter) GetMemory() *RateLimiter_Memory
func (*RateLimiter) GetName ¶
func (x *RateLimiter) GetName() string
func (*RateLimiter) GetPeriod ¶
func (x *RateLimiter) GetPeriod() int32
func (*RateLimiter) GetRedis ¶
func (x *RateLimiter) GetRedis() *RateLimiter_Redis
func (*RateLimiter) GetRetryAfter ¶
func (x *RateLimiter) GetRetryAfter() int32
func (*RateLimiter) GetXRatelimitLimit ¶
func (x *RateLimiter) GetXRatelimitLimit() int32
func (*RateLimiter) GetXRatelimitRemaining ¶
func (x *RateLimiter) GetXRatelimitRemaining() int32
func (*RateLimiter) GetXRatelimitReset ¶
func (x *RateLimiter) GetXRatelimitReset() int32
func (*RateLimiter) ProtoMessage ¶
func (*RateLimiter) ProtoMessage()
func (*RateLimiter) ProtoReflect ¶
func (x *RateLimiter) ProtoReflect() protoreflect.Message
func (*RateLimiter) Reset ¶
func (x *RateLimiter) Reset()
func (*RateLimiter) String ¶
func (x *RateLimiter) String() string
func (*RateLimiter) Validate ¶
func (m *RateLimiter) Validate() error
Validate checks the field values on RateLimiter with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*RateLimiter) ValidateAll ¶
func (m *RateLimiter) ValidateAll() error
ValidateAll checks the field values on RateLimiter with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RateLimiterMultiError, or nil if none found.
type RateLimiterMultiError ¶
type RateLimiterMultiError []error
RateLimiterMultiError is an error wrapping multiple validation errors returned by RateLimiter.ValidateAll() if the designated constraints aren't met.
func (RateLimiterMultiError) AllErrors ¶
func (m RateLimiterMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RateLimiterMultiError) Error ¶
func (m RateLimiterMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RateLimiterValidationError ¶
type RateLimiterValidationError struct {
// contains filtered or unexported fields
}
RateLimiterValidationError is the validation error returned by RateLimiter.Validate if the designated constraints aren't met.
func (RateLimiterValidationError) Cause ¶
func (e RateLimiterValidationError) Cause() error
Cause function returns cause value.
func (RateLimiterValidationError) Error ¶
func (e RateLimiterValidationError) Error() string
Error satisfies the builtin error interface
func (RateLimiterValidationError) ErrorName ¶
func (e RateLimiterValidationError) ErrorName() string
ErrorName returns error name.
func (RateLimiterValidationError) Field ¶
func (e RateLimiterValidationError) Field() string
Field function returns field value.
func (RateLimiterValidationError) Key ¶
func (e RateLimiterValidationError) Key() bool
Key function returns key value.
func (RateLimiterValidationError) Reason ¶
func (e RateLimiterValidationError) Reason() string
Reason function returns reason value.
type RateLimiter_Memory ¶
type RateLimiter_Memory struct { Expiration *durationpb.Duration `protobuf:"bytes,1,opt,name=expiration,proto3" json:"expiration,omitempty"` CleanupInterval *durationpb.Duration `protobuf:"bytes,2,opt,name=cleanup_interval,proto3" json:"cleanup_interval,omitempty"` // contains filtered or unexported fields }
func (*RateLimiter_Memory) Descriptor
deprecated
func (*RateLimiter_Memory) Descriptor() ([]byte, []int)
Deprecated: Use RateLimiter_Memory.ProtoReflect.Descriptor instead.
func (*RateLimiter_Memory) GetCleanupInterval ¶
func (x *RateLimiter_Memory) GetCleanupInterval() *durationpb.Duration
func (*RateLimiter_Memory) GetExpiration ¶
func (x *RateLimiter_Memory) GetExpiration() *durationpb.Duration
func (*RateLimiter_Memory) ProtoMessage ¶
func (*RateLimiter_Memory) ProtoMessage()
func (*RateLimiter_Memory) ProtoReflect ¶
func (x *RateLimiter_Memory) ProtoReflect() protoreflect.Message
func (*RateLimiter_Memory) Reset ¶
func (x *RateLimiter_Memory) Reset()
func (*RateLimiter_Memory) String ¶
func (x *RateLimiter_Memory) String() string
func (*RateLimiter_Memory) Validate ¶
func (m *RateLimiter_Memory) Validate() error
Validate checks the field values on RateLimiter_Memory with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*RateLimiter_Memory) ValidateAll ¶
func (m *RateLimiter_Memory) ValidateAll() error
ValidateAll checks the field values on RateLimiter_Memory with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RateLimiter_MemoryMultiError, or nil if none found.
type RateLimiter_MemoryMultiError ¶
type RateLimiter_MemoryMultiError []error
RateLimiter_MemoryMultiError is an error wrapping multiple validation errors returned by RateLimiter_Memory.ValidateAll() if the designated constraints aren't met.
func (RateLimiter_MemoryMultiError) AllErrors ¶
func (m RateLimiter_MemoryMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RateLimiter_MemoryMultiError) Error ¶
func (m RateLimiter_MemoryMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RateLimiter_MemoryValidationError ¶
type RateLimiter_MemoryValidationError struct {
// contains filtered or unexported fields
}
RateLimiter_MemoryValidationError is the validation error returned by RateLimiter_Memory.Validate if the designated constraints aren't met.
func (RateLimiter_MemoryValidationError) Cause ¶
func (e RateLimiter_MemoryValidationError) Cause() error
Cause function returns cause value.
func (RateLimiter_MemoryValidationError) Error ¶
func (e RateLimiter_MemoryValidationError) Error() string
Error satisfies the builtin error interface
func (RateLimiter_MemoryValidationError) ErrorName ¶
func (e RateLimiter_MemoryValidationError) ErrorName() string
ErrorName returns error name.
func (RateLimiter_MemoryValidationError) Field ¶
func (e RateLimiter_MemoryValidationError) Field() string
Field function returns field value.
func (RateLimiter_MemoryValidationError) Key ¶
func (e RateLimiter_MemoryValidationError) Key() bool
Key function returns key value.
func (RateLimiter_MemoryValidationError) Reason ¶
func (e RateLimiter_MemoryValidationError) Reason() string
Reason function returns reason value.
type RateLimiter_Redis ¶
type RateLimiter_Redis struct { Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` Db int32 `protobuf:"varint,4,opt,name=db,proto3" json:"db,omitempty"` // contains filtered or unexported fields }
func (*RateLimiter_Redis) Descriptor
deprecated
func (*RateLimiter_Redis) Descriptor() ([]byte, []int)
Deprecated: Use RateLimiter_Redis.ProtoReflect.Descriptor instead.
func (*RateLimiter_Redis) GetAddr ¶
func (x *RateLimiter_Redis) GetAddr() string
func (*RateLimiter_Redis) GetDb ¶
func (x *RateLimiter_Redis) GetDb() int32
func (*RateLimiter_Redis) GetPassword ¶
func (x *RateLimiter_Redis) GetPassword() string
func (*RateLimiter_Redis) GetUsername ¶
func (x *RateLimiter_Redis) GetUsername() string
func (*RateLimiter_Redis) ProtoMessage ¶
func (*RateLimiter_Redis) ProtoMessage()
func (*RateLimiter_Redis) ProtoReflect ¶
func (x *RateLimiter_Redis) ProtoReflect() protoreflect.Message
func (*RateLimiter_Redis) Reset ¶
func (x *RateLimiter_Redis) Reset()
func (*RateLimiter_Redis) String ¶
func (x *RateLimiter_Redis) String() string
func (*RateLimiter_Redis) Validate ¶
func (m *RateLimiter_Redis) Validate() error
Validate checks the field values on RateLimiter_Redis with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*RateLimiter_Redis) ValidateAll ¶
func (m *RateLimiter_Redis) ValidateAll() error
ValidateAll checks the field values on RateLimiter_Redis with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in RateLimiter_RedisMultiError, or nil if none found.
type RateLimiter_RedisMultiError ¶
type RateLimiter_RedisMultiError []error
RateLimiter_RedisMultiError is an error wrapping multiple validation errors returned by RateLimiter_Redis.ValidateAll() if the designated constraints aren't met.
func (RateLimiter_RedisMultiError) AllErrors ¶
func (m RateLimiter_RedisMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RateLimiter_RedisMultiError) Error ¶
func (m RateLimiter_RedisMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RateLimiter_RedisValidationError ¶
type RateLimiter_RedisValidationError struct {
// contains filtered or unexported fields
}
RateLimiter_RedisValidationError is the validation error returned by RateLimiter_Redis.Validate if the designated constraints aren't met.
func (RateLimiter_RedisValidationError) Cause ¶
func (e RateLimiter_RedisValidationError) Cause() error
Cause function returns cause value.
func (RateLimiter_RedisValidationError) Error ¶
func (e RateLimiter_RedisValidationError) Error() string
Error satisfies the builtin error interface
func (RateLimiter_RedisValidationError) ErrorName ¶
func (e RateLimiter_RedisValidationError) ErrorName() string
ErrorName returns error name.
func (RateLimiter_RedisValidationError) Field ¶
func (e RateLimiter_RedisValidationError) Field() string
Field function returns field value.
func (RateLimiter_RedisValidationError) Key ¶
func (e RateLimiter_RedisValidationError) Key() bool
Key function returns key value.
func (RateLimiter_RedisValidationError) Reason ¶
func (e RateLimiter_RedisValidationError) Reason() string
Reason function returns reason value.