Documentation ¶
Index ¶
- Variables
- func RegisterRateLimitServiceServer(s *grpc.Server, srv RateLimitServiceServer)
- type RateLimitRequest
- func (*RateLimitRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RateLimitRequest) GetDescriptors() []*ratelimit.RateLimitDescriptor
- func (x *RateLimitRequest) GetDomain() string
- func (x *RateLimitRequest) GetHitsAddend() uint32
- func (*RateLimitRequest) ProtoMessage()
- func (x *RateLimitRequest) ProtoReflect() protoreflect.Message
- func (x *RateLimitRequest) Reset()
- func (x *RateLimitRequest) String() string
- func (m *RateLimitRequest) Validate() error
- func (m *RateLimitRequest) ValidateAll() error
- type RateLimitRequestMultiError
- type RateLimitRequestValidationError
- func (e RateLimitRequestValidationError) Cause() error
- func (e RateLimitRequestValidationError) Error() string
- func (e RateLimitRequestValidationError) ErrorName() string
- func (e RateLimitRequestValidationError) Field() string
- func (e RateLimitRequestValidationError) Key() bool
- func (e RateLimitRequestValidationError) Reason() string
- type RateLimitResponse
- func (*RateLimitResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RateLimitResponse) GetHeaders() []*core.HeaderValue
- func (x *RateLimitResponse) GetOverallCode() RateLimitResponse_Code
- func (x *RateLimitResponse) GetRequestHeadersToAdd() []*core.HeaderValue
- func (x *RateLimitResponse) GetStatuses() []*RateLimitResponse_DescriptorStatus
- func (*RateLimitResponse) ProtoMessage()
- func (x *RateLimitResponse) ProtoReflect() protoreflect.Message
- func (x *RateLimitResponse) Reset()
- func (x *RateLimitResponse) String() string
- func (m *RateLimitResponse) Validate() error
- func (m *RateLimitResponse) ValidateAll() error
- type RateLimitResponseMultiError
- type RateLimitResponseValidationError
- func (e RateLimitResponseValidationError) Cause() error
- func (e RateLimitResponseValidationError) Error() string
- func (e RateLimitResponseValidationError) ErrorName() string
- func (e RateLimitResponseValidationError) Field() string
- func (e RateLimitResponseValidationError) Key() bool
- func (e RateLimitResponseValidationError) Reason() string
- type RateLimitResponse_Code
- func (RateLimitResponse_Code) Descriptor() protoreflect.EnumDescriptor
- func (x RateLimitResponse_Code) Enum() *RateLimitResponse_Code
- func (RateLimitResponse_Code) EnumDescriptor() ([]byte, []int)deprecated
- func (x RateLimitResponse_Code) Number() protoreflect.EnumNumber
- func (x RateLimitResponse_Code) String() string
- func (RateLimitResponse_Code) Type() protoreflect.EnumType
- type RateLimitResponse_DescriptorStatus
- func (*RateLimitResponse_DescriptorStatus) Descriptor() ([]byte, []int)deprecated
- func (x *RateLimitResponse_DescriptorStatus) GetCode() RateLimitResponse_Code
- func (x *RateLimitResponse_DescriptorStatus) GetCurrentLimit() *RateLimitResponse_RateLimit
- func (x *RateLimitResponse_DescriptorStatus) GetLimitRemaining() uint32
- func (*RateLimitResponse_DescriptorStatus) ProtoMessage()
- func (x *RateLimitResponse_DescriptorStatus) ProtoReflect() protoreflect.Message
- func (x *RateLimitResponse_DescriptorStatus) Reset()
- func (x *RateLimitResponse_DescriptorStatus) String() string
- func (m *RateLimitResponse_DescriptorStatus) Validate() error
- func (m *RateLimitResponse_DescriptorStatus) ValidateAll() error
- type RateLimitResponse_DescriptorStatusMultiError
- type RateLimitResponse_DescriptorStatusValidationError
- func (e RateLimitResponse_DescriptorStatusValidationError) Cause() error
- func (e RateLimitResponse_DescriptorStatusValidationError) Error() string
- func (e RateLimitResponse_DescriptorStatusValidationError) ErrorName() string
- func (e RateLimitResponse_DescriptorStatusValidationError) Field() string
- func (e RateLimitResponse_DescriptorStatusValidationError) Key() bool
- func (e RateLimitResponse_DescriptorStatusValidationError) Reason() string
- type RateLimitResponse_RateLimit
- func (*RateLimitResponse_RateLimit) Descriptor() ([]byte, []int)deprecated
- func (x *RateLimitResponse_RateLimit) GetName() string
- func (x *RateLimitResponse_RateLimit) GetRequestsPerUnit() uint32
- func (x *RateLimitResponse_RateLimit) GetUnit() RateLimitResponse_RateLimit_Unit
- func (*RateLimitResponse_RateLimit) ProtoMessage()
- func (x *RateLimitResponse_RateLimit) ProtoReflect() protoreflect.Message
- func (x *RateLimitResponse_RateLimit) Reset()
- func (x *RateLimitResponse_RateLimit) String() string
- func (m *RateLimitResponse_RateLimit) Validate() error
- func (m *RateLimitResponse_RateLimit) ValidateAll() error
- type RateLimitResponse_RateLimitMultiError
- type RateLimitResponse_RateLimitValidationError
- func (e RateLimitResponse_RateLimitValidationError) Cause() error
- func (e RateLimitResponse_RateLimitValidationError) Error() string
- func (e RateLimitResponse_RateLimitValidationError) ErrorName() string
- func (e RateLimitResponse_RateLimitValidationError) Field() string
- func (e RateLimitResponse_RateLimitValidationError) Key() bool
- func (e RateLimitResponse_RateLimitValidationError) Reason() string
- type RateLimitResponse_RateLimit_Unit
- func (RateLimitResponse_RateLimit_Unit) Descriptor() protoreflect.EnumDescriptor
- func (x RateLimitResponse_RateLimit_Unit) Enum() *RateLimitResponse_RateLimit_Unit
- func (RateLimitResponse_RateLimit_Unit) EnumDescriptor() ([]byte, []int)deprecated
- func (x RateLimitResponse_RateLimit_Unit) Number() protoreflect.EnumNumber
- func (x RateLimitResponse_RateLimit_Unit) String() string
- func (RateLimitResponse_RateLimit_Unit) Type() protoreflect.EnumType
- type RateLimitServiceClient
- type RateLimitServiceServer
- type UnimplementedRateLimitServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( RateLimitResponse_Code_name = map[int32]string{ 0: "UNKNOWN", 1: "OK", 2: "OVER_LIMIT", } RateLimitResponse_Code_value = map[string]int32{ "UNKNOWN": 0, "OK": 1, "OVER_LIMIT": 2, } )
Enum value maps for RateLimitResponse_Code.
var ( RateLimitResponse_RateLimit_Unit_name = map[int32]string{ 0: "UNKNOWN", 1: "SECOND", 2: "MINUTE", 3: "HOUR", 4: "DAY", } RateLimitResponse_RateLimit_Unit_value = map[string]int32{ "UNKNOWN": 0, "SECOND": 1, "MINUTE": 2, "HOUR": 3, "DAY": 4, } )
Enum value maps for RateLimitResponse_RateLimit_Unit.
var File_envoy_service_ratelimit_v2_rls_proto protoreflect.FileDescriptor
Functions ¶
func RegisterRateLimitServiceServer ¶
func RegisterRateLimitServiceServer(s *grpc.Server, srv RateLimitServiceServer)
Types ¶
type RateLimitRequest ¶
type RateLimitRequest struct { // All rate limit requests must specify a domain. This enables the configuration to be per // application without fear of overlap. E.g., "envoy". Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` // All rate limit requests must specify at least one RateLimitDescriptor. Each descriptor is // processed by the service (see below). If any of the descriptors are over limit, the entire // request is considered to be over limit. Descriptors []*ratelimit.RateLimitDescriptor `protobuf:"bytes,2,rep,name=descriptors,proto3" json:"descriptors,omitempty"` // Rate limit requests can optionally specify the number of hits a request adds to the matched // limit. If the value is not set in the message, a request increases the matched limit by 1. HitsAddend uint32 `protobuf:"varint,3,opt,name=hits_addend,json=hitsAddend,proto3" json:"hits_addend,omitempty"` // contains filtered or unexported fields }
Main message for a rate limit request. The rate limit service is designed to be fully generic in the sense that it can operate on arbitrary hierarchical key/value pairs. The loaded configuration will parse the request and find the most specific limit to apply. In addition, a RateLimitRequest can contain multiple "descriptors" to limit on. When multiple descriptors are provided, the server will limit on *ALL* of them and return an OVER_LIMIT response if any of them are over limit. This enables more complex application level rate limiting scenarios if desired.
func (*RateLimitRequest) Descriptor
deprecated
func (*RateLimitRequest) Descriptor() ([]byte, []int)
Deprecated: Use RateLimitRequest.ProtoReflect.Descriptor instead.
func (*RateLimitRequest) GetDescriptors ¶
func (x *RateLimitRequest) GetDescriptors() []*ratelimit.RateLimitDescriptor
func (*RateLimitRequest) GetDomain ¶
func (x *RateLimitRequest) GetDomain() string
func (*RateLimitRequest) GetHitsAddend ¶
func (x *RateLimitRequest) GetHitsAddend() uint32
func (*RateLimitRequest) ProtoMessage ¶
func (*RateLimitRequest) ProtoMessage()
func (*RateLimitRequest) ProtoReflect ¶
func (x *RateLimitRequest) ProtoReflect() protoreflect.Message
func (*RateLimitRequest) Reset ¶
func (x *RateLimitRequest) Reset()
func (*RateLimitRequest) String ¶
func (x *RateLimitRequest) String() string
func (*RateLimitRequest) Validate ¶
func (m *RateLimitRequest) Validate() error
Validate checks the field values on RateLimitRequest 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 (*RateLimitRequest) ValidateAll ¶
func (m *RateLimitRequest) ValidateAll() error
ValidateAll checks the field values on RateLimitRequest 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 RateLimitRequestMultiError, or nil if none found.
type RateLimitRequestMultiError ¶
type RateLimitRequestMultiError []error
RateLimitRequestMultiError is an error wrapping multiple validation errors returned by RateLimitRequest.ValidateAll() if the designated constraints aren't met.
func (RateLimitRequestMultiError) AllErrors ¶
func (m RateLimitRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RateLimitRequestMultiError) Error ¶
func (m RateLimitRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RateLimitRequestValidationError ¶
type RateLimitRequestValidationError struct {
// contains filtered or unexported fields
}
RateLimitRequestValidationError is the validation error returned by RateLimitRequest.Validate if the designated constraints aren't met.
func (RateLimitRequestValidationError) Cause ¶
func (e RateLimitRequestValidationError) Cause() error
Cause function returns cause value.
func (RateLimitRequestValidationError) Error ¶
func (e RateLimitRequestValidationError) Error() string
Error satisfies the builtin error interface
func (RateLimitRequestValidationError) ErrorName ¶
func (e RateLimitRequestValidationError) ErrorName() string
ErrorName returns error name.
func (RateLimitRequestValidationError) Field ¶
func (e RateLimitRequestValidationError) Field() string
Field function returns field value.
func (RateLimitRequestValidationError) Key ¶
func (e RateLimitRequestValidationError) Key() bool
Key function returns key value.
func (RateLimitRequestValidationError) Reason ¶
func (e RateLimitRequestValidationError) Reason() string
Reason function returns reason value.
type RateLimitResponse ¶
type RateLimitResponse struct { // The overall response code which takes into account all of the descriptors that were passed // in the RateLimitRequest message. OverallCode RateLimitResponse_Code `` /* 150-byte string literal not displayed */ // A list of DescriptorStatus messages which matches the length of the descriptor list passed // in the RateLimitRequest. This can be used by the caller to determine which individual // descriptors failed and/or what the currently configured limits are for all of them. Statuses []*RateLimitResponse_DescriptorStatus `protobuf:"bytes,2,rep,name=statuses,proto3" json:"statuses,omitempty"` // A list of headers to add to the response Headers []*core.HeaderValue `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"` // A list of headers to add to the request when forwarded RequestHeadersToAdd []*core.HeaderValue `protobuf:"bytes,4,rep,name=request_headers_to_add,json=requestHeadersToAdd,proto3" json:"request_headers_to_add,omitempty"` // contains filtered or unexported fields }
A response from a ShouldRateLimit call.
func (*RateLimitResponse) Descriptor
deprecated
func (*RateLimitResponse) Descriptor() ([]byte, []int)
Deprecated: Use RateLimitResponse.ProtoReflect.Descriptor instead.
func (*RateLimitResponse) GetHeaders ¶
func (x *RateLimitResponse) GetHeaders() []*core.HeaderValue
func (*RateLimitResponse) GetOverallCode ¶
func (x *RateLimitResponse) GetOverallCode() RateLimitResponse_Code
func (*RateLimitResponse) GetRequestHeadersToAdd ¶
func (x *RateLimitResponse) GetRequestHeadersToAdd() []*core.HeaderValue
func (*RateLimitResponse) GetStatuses ¶
func (x *RateLimitResponse) GetStatuses() []*RateLimitResponse_DescriptorStatus
func (*RateLimitResponse) ProtoMessage ¶
func (*RateLimitResponse) ProtoMessage()
func (*RateLimitResponse) ProtoReflect ¶
func (x *RateLimitResponse) ProtoReflect() protoreflect.Message
func (*RateLimitResponse) Reset ¶
func (x *RateLimitResponse) Reset()
func (*RateLimitResponse) String ¶
func (x *RateLimitResponse) String() string
func (*RateLimitResponse) Validate ¶
func (m *RateLimitResponse) Validate() error
Validate checks the field values on RateLimitResponse 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 (*RateLimitResponse) ValidateAll ¶
func (m *RateLimitResponse) ValidateAll() error
ValidateAll checks the field values on RateLimitResponse 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 RateLimitResponseMultiError, or nil if none found.
type RateLimitResponseMultiError ¶
type RateLimitResponseMultiError []error
RateLimitResponseMultiError is an error wrapping multiple validation errors returned by RateLimitResponse.ValidateAll() if the designated constraints aren't met.
func (RateLimitResponseMultiError) AllErrors ¶
func (m RateLimitResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RateLimitResponseMultiError) Error ¶
func (m RateLimitResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RateLimitResponseValidationError ¶
type RateLimitResponseValidationError struct {
// contains filtered or unexported fields
}
RateLimitResponseValidationError is the validation error returned by RateLimitResponse.Validate if the designated constraints aren't met.
func (RateLimitResponseValidationError) Cause ¶
func (e RateLimitResponseValidationError) Cause() error
Cause function returns cause value.
func (RateLimitResponseValidationError) Error ¶
func (e RateLimitResponseValidationError) Error() string
Error satisfies the builtin error interface
func (RateLimitResponseValidationError) ErrorName ¶
func (e RateLimitResponseValidationError) ErrorName() string
ErrorName returns error name.
func (RateLimitResponseValidationError) Field ¶
func (e RateLimitResponseValidationError) Field() string
Field function returns field value.
func (RateLimitResponseValidationError) Key ¶
func (e RateLimitResponseValidationError) Key() bool
Key function returns key value.
func (RateLimitResponseValidationError) Reason ¶
func (e RateLimitResponseValidationError) Reason() string
Reason function returns reason value.
type RateLimitResponse_Code ¶
type RateLimitResponse_Code int32
const ( // The response code is not known. RateLimitResponse_UNKNOWN RateLimitResponse_Code = 0 // The response code to notify that the number of requests are under limit. RateLimitResponse_OK RateLimitResponse_Code = 1 // The response code to notify that the number of requests are over limit. RateLimitResponse_OVER_LIMIT RateLimitResponse_Code = 2 )
func (RateLimitResponse_Code) Descriptor ¶
func (RateLimitResponse_Code) Descriptor() protoreflect.EnumDescriptor
func (RateLimitResponse_Code) Enum ¶
func (x RateLimitResponse_Code) Enum() *RateLimitResponse_Code
func (RateLimitResponse_Code) EnumDescriptor
deprecated
func (RateLimitResponse_Code) EnumDescriptor() ([]byte, []int)
Deprecated: Use RateLimitResponse_Code.Descriptor instead.
func (RateLimitResponse_Code) Number ¶
func (x RateLimitResponse_Code) Number() protoreflect.EnumNumber
func (RateLimitResponse_Code) String ¶
func (x RateLimitResponse_Code) String() string
func (RateLimitResponse_Code) Type ¶
func (RateLimitResponse_Code) Type() protoreflect.EnumType
type RateLimitResponse_DescriptorStatus ¶
type RateLimitResponse_DescriptorStatus struct { // The response code for an individual descriptor. Code RateLimitResponse_Code `protobuf:"varint,1,opt,name=code,proto3,enum=envoy.service.ratelimit.v2.RateLimitResponse_Code" json:"code,omitempty"` // The current limit as configured by the server. Useful for debugging, etc. CurrentLimit *RateLimitResponse_RateLimit `protobuf:"bytes,2,opt,name=current_limit,json=currentLimit,proto3" json:"current_limit,omitempty"` // The limit remaining in the current time unit. LimitRemaining uint32 `protobuf:"varint,3,opt,name=limit_remaining,json=limitRemaining,proto3" json:"limit_remaining,omitempty"` // contains filtered or unexported fields }
func (*RateLimitResponse_DescriptorStatus) Descriptor
deprecated
func (*RateLimitResponse_DescriptorStatus) Descriptor() ([]byte, []int)
Deprecated: Use RateLimitResponse_DescriptorStatus.ProtoReflect.Descriptor instead.
func (*RateLimitResponse_DescriptorStatus) GetCode ¶
func (x *RateLimitResponse_DescriptorStatus) GetCode() RateLimitResponse_Code
func (*RateLimitResponse_DescriptorStatus) GetCurrentLimit ¶
func (x *RateLimitResponse_DescriptorStatus) GetCurrentLimit() *RateLimitResponse_RateLimit
func (*RateLimitResponse_DescriptorStatus) GetLimitRemaining ¶
func (x *RateLimitResponse_DescriptorStatus) GetLimitRemaining() uint32
func (*RateLimitResponse_DescriptorStatus) ProtoMessage ¶
func (*RateLimitResponse_DescriptorStatus) ProtoMessage()
func (*RateLimitResponse_DescriptorStatus) ProtoReflect ¶
func (x *RateLimitResponse_DescriptorStatus) ProtoReflect() protoreflect.Message
func (*RateLimitResponse_DescriptorStatus) Reset ¶
func (x *RateLimitResponse_DescriptorStatus) Reset()
func (*RateLimitResponse_DescriptorStatus) String ¶
func (x *RateLimitResponse_DescriptorStatus) String() string
func (*RateLimitResponse_DescriptorStatus) Validate ¶
func (m *RateLimitResponse_DescriptorStatus) Validate() error
Validate checks the field values on RateLimitResponse_DescriptorStatus 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 (*RateLimitResponse_DescriptorStatus) ValidateAll ¶
func (m *RateLimitResponse_DescriptorStatus) ValidateAll() error
ValidateAll checks the field values on RateLimitResponse_DescriptorStatus 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 RateLimitResponse_DescriptorStatusMultiError, or nil if none found.
type RateLimitResponse_DescriptorStatusMultiError ¶
type RateLimitResponse_DescriptorStatusMultiError []error
RateLimitResponse_DescriptorStatusMultiError is an error wrapping multiple validation errors returned by RateLimitResponse_DescriptorStatus.ValidateAll() if the designated constraints aren't met.
func (RateLimitResponse_DescriptorStatusMultiError) AllErrors ¶
func (m RateLimitResponse_DescriptorStatusMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RateLimitResponse_DescriptorStatusMultiError) Error ¶
func (m RateLimitResponse_DescriptorStatusMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RateLimitResponse_DescriptorStatusValidationError ¶
type RateLimitResponse_DescriptorStatusValidationError struct {
// contains filtered or unexported fields
}
RateLimitResponse_DescriptorStatusValidationError is the validation error returned by RateLimitResponse_DescriptorStatus.Validate if the designated constraints aren't met.
func (RateLimitResponse_DescriptorStatusValidationError) Cause ¶
func (e RateLimitResponse_DescriptorStatusValidationError) Cause() error
Cause function returns cause value.
func (RateLimitResponse_DescriptorStatusValidationError) Error ¶
func (e RateLimitResponse_DescriptorStatusValidationError) Error() string
Error satisfies the builtin error interface
func (RateLimitResponse_DescriptorStatusValidationError) ErrorName ¶
func (e RateLimitResponse_DescriptorStatusValidationError) ErrorName() string
ErrorName returns error name.
func (RateLimitResponse_DescriptorStatusValidationError) Field ¶
func (e RateLimitResponse_DescriptorStatusValidationError) Field() string
Field function returns field value.
func (RateLimitResponse_DescriptorStatusValidationError) Key ¶
func (e RateLimitResponse_DescriptorStatusValidationError) Key() bool
Key function returns key value.
func (RateLimitResponse_DescriptorStatusValidationError) Reason ¶
func (e RateLimitResponse_DescriptorStatusValidationError) Reason() string
Reason function returns reason value.
type RateLimitResponse_RateLimit ¶
type RateLimitResponse_RateLimit struct { // A name or description of this limit. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // The number of requests per unit of time. RequestsPerUnit uint32 `protobuf:"varint,1,opt,name=requests_per_unit,json=requestsPerUnit,proto3" json:"requests_per_unit,omitempty"` // The unit of time. Unit RateLimitResponse_RateLimit_Unit `` /* 127-byte string literal not displayed */ // contains filtered or unexported fields }
Defines an actual rate limit in terms of requests per unit of time and the unit itself.
func (*RateLimitResponse_RateLimit) Descriptor
deprecated
func (*RateLimitResponse_RateLimit) Descriptor() ([]byte, []int)
Deprecated: Use RateLimitResponse_RateLimit.ProtoReflect.Descriptor instead.
func (*RateLimitResponse_RateLimit) GetName ¶
func (x *RateLimitResponse_RateLimit) GetName() string
func (*RateLimitResponse_RateLimit) GetRequestsPerUnit ¶
func (x *RateLimitResponse_RateLimit) GetRequestsPerUnit() uint32
func (*RateLimitResponse_RateLimit) GetUnit ¶
func (x *RateLimitResponse_RateLimit) GetUnit() RateLimitResponse_RateLimit_Unit
func (*RateLimitResponse_RateLimit) ProtoMessage ¶
func (*RateLimitResponse_RateLimit) ProtoMessage()
func (*RateLimitResponse_RateLimit) ProtoReflect ¶
func (x *RateLimitResponse_RateLimit) ProtoReflect() protoreflect.Message
func (*RateLimitResponse_RateLimit) Reset ¶
func (x *RateLimitResponse_RateLimit) Reset()
func (*RateLimitResponse_RateLimit) String ¶
func (x *RateLimitResponse_RateLimit) String() string
func (*RateLimitResponse_RateLimit) Validate ¶
func (m *RateLimitResponse_RateLimit) Validate() error
Validate checks the field values on RateLimitResponse_RateLimit 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 (*RateLimitResponse_RateLimit) ValidateAll ¶
func (m *RateLimitResponse_RateLimit) ValidateAll() error
ValidateAll checks the field values on RateLimitResponse_RateLimit 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 RateLimitResponse_RateLimitMultiError, or nil if none found.
type RateLimitResponse_RateLimitMultiError ¶
type RateLimitResponse_RateLimitMultiError []error
RateLimitResponse_RateLimitMultiError is an error wrapping multiple validation errors returned by RateLimitResponse_RateLimit.ValidateAll() if the designated constraints aren't met.
func (RateLimitResponse_RateLimitMultiError) AllErrors ¶
func (m RateLimitResponse_RateLimitMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RateLimitResponse_RateLimitMultiError) Error ¶
func (m RateLimitResponse_RateLimitMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RateLimitResponse_RateLimitValidationError ¶
type RateLimitResponse_RateLimitValidationError struct {
// contains filtered or unexported fields
}
RateLimitResponse_RateLimitValidationError is the validation error returned by RateLimitResponse_RateLimit.Validate if the designated constraints aren't met.
func (RateLimitResponse_RateLimitValidationError) Cause ¶
func (e RateLimitResponse_RateLimitValidationError) Cause() error
Cause function returns cause value.
func (RateLimitResponse_RateLimitValidationError) Error ¶
func (e RateLimitResponse_RateLimitValidationError) Error() string
Error satisfies the builtin error interface
func (RateLimitResponse_RateLimitValidationError) ErrorName ¶
func (e RateLimitResponse_RateLimitValidationError) ErrorName() string
ErrorName returns error name.
func (RateLimitResponse_RateLimitValidationError) Field ¶
func (e RateLimitResponse_RateLimitValidationError) Field() string
Field function returns field value.
func (RateLimitResponse_RateLimitValidationError) Key ¶
func (e RateLimitResponse_RateLimitValidationError) Key() bool
Key function returns key value.
func (RateLimitResponse_RateLimitValidationError) Reason ¶
func (e RateLimitResponse_RateLimitValidationError) Reason() string
Reason function returns reason value.
type RateLimitResponse_RateLimit_Unit ¶
type RateLimitResponse_RateLimit_Unit int32
const ( // The time unit is not known. RateLimitResponse_RateLimit_UNKNOWN RateLimitResponse_RateLimit_Unit = 0 // The time unit representing a second. RateLimitResponse_RateLimit_SECOND RateLimitResponse_RateLimit_Unit = 1 // The time unit representing a minute. RateLimitResponse_RateLimit_MINUTE RateLimitResponse_RateLimit_Unit = 2 // The time unit representing an hour. RateLimitResponse_RateLimit_HOUR RateLimitResponse_RateLimit_Unit = 3 // The time unit representing a day. RateLimitResponse_RateLimit_DAY RateLimitResponse_RateLimit_Unit = 4 )
func (RateLimitResponse_RateLimit_Unit) Descriptor ¶
func (RateLimitResponse_RateLimit_Unit) Descriptor() protoreflect.EnumDescriptor
func (RateLimitResponse_RateLimit_Unit) Enum ¶
func (x RateLimitResponse_RateLimit_Unit) Enum() *RateLimitResponse_RateLimit_Unit
func (RateLimitResponse_RateLimit_Unit) EnumDescriptor
deprecated
func (RateLimitResponse_RateLimit_Unit) EnumDescriptor() ([]byte, []int)
Deprecated: Use RateLimitResponse_RateLimit_Unit.Descriptor instead.
func (RateLimitResponse_RateLimit_Unit) Number ¶
func (x RateLimitResponse_RateLimit_Unit) Number() protoreflect.EnumNumber
func (RateLimitResponse_RateLimit_Unit) String ¶
func (x RateLimitResponse_RateLimit_Unit) String() string
func (RateLimitResponse_RateLimit_Unit) Type ¶
func (RateLimitResponse_RateLimit_Unit) Type() protoreflect.EnumType
type RateLimitServiceClient ¶
type RateLimitServiceClient interface { // Determine whether rate limiting should take place. ShouldRateLimit(ctx context.Context, in *RateLimitRequest, opts ...grpc.CallOption) (*RateLimitResponse, error) }
RateLimitServiceClient is the client API for RateLimitService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewRateLimitServiceClient ¶
func NewRateLimitServiceClient(cc grpc.ClientConnInterface) RateLimitServiceClient
type RateLimitServiceServer ¶
type RateLimitServiceServer interface { // Determine whether rate limiting should take place. ShouldRateLimit(context.Context, *RateLimitRequest) (*RateLimitResponse, error) }
RateLimitServiceServer is the server API for RateLimitService service.
type UnimplementedRateLimitServiceServer ¶
type UnimplementedRateLimitServiceServer struct { }
UnimplementedRateLimitServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedRateLimitServiceServer) ShouldRateLimit ¶
func (*UnimplementedRateLimitServiceServer) ShouldRateLimit(context.Context, *RateLimitRequest) (*RateLimitResponse, error)