v2

package
v0.0.0-...-113c6ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package v2 is a generated protocol buffer package.

It is generated from these files:

envoy/service/ratelimit/v2/rls.proto

It has these top-level messages:

RateLimitRequest
RateLimitResponse

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRls = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRls   = fmt.Errorf("proto: integer overflow")
)
View Source
var RateLimitResponse_Code_name = map[int32]string{
	0: "UNKNOWN",
	1: "OK",
	2: "OVER_LIMIT",
}
View Source
var RateLimitResponse_Code_value = map[string]int32{
	"UNKNOWN":    0,
	"OK":         1,
	"OVER_LIMIT": 2,
}
View Source
var RateLimitResponse_RateLimit_Unit_name = map[int32]string{
	0: "UNKNOWN",
	1: "SECOND",
	2: "MINUTE",
	3: "HOUR",
	4: "DAY",
}
View Source
var RateLimitResponse_RateLimit_Unit_value = map[string]int32{
	"UNKNOWN": 0,
	"SECOND":  1,
	"MINUTE":  2,
	"HOUR":    3,
	"DAY":     4,
}

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 []*envoy_api_v2_ratelimit.RateLimitDescriptor `protobuf:"bytes,2,rep,name=descriptors" 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"`
}

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. [#not-implemented-hide:] Hiding API for now.

func (*RateLimitRequest) Descriptor

func (*RateLimitRequest) Descriptor() ([]byte, []int)

func (*RateLimitRequest) GetDescriptors

func (*RateLimitRequest) GetDomain

func (m *RateLimitRequest) GetDomain() string

func (*RateLimitRequest) GetHitsAddend

func (m *RateLimitRequest) GetHitsAddend() uint32

func (*RateLimitRequest) Marshal

func (m *RateLimitRequest) Marshal() (dAtA []byte, err error)

func (*RateLimitRequest) MarshalTo

func (m *RateLimitRequest) MarshalTo(dAtA []byte) (int, error)

func (*RateLimitRequest) ProtoMessage

func (*RateLimitRequest) ProtoMessage()

func (*RateLimitRequest) Reset

func (m *RateLimitRequest) Reset()

func (*RateLimitRequest) Size

func (m *RateLimitRequest) Size() (n int)

func (*RateLimitRequest) String

func (m *RateLimitRequest) String() string

func (*RateLimitRequest) Unmarshal

func (m *RateLimitRequest) Unmarshal(dAtA []byte) error

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, an error is returned.

type RateLimitRequestValidationError

type RateLimitRequestValidationError struct {
	Field  string
	Reason string
	Cause  error
	Key    bool
}

RateLimitRequestValidationError is the validation error returned by RateLimitRequest.Validate if the designated constraints aren't met.

func (RateLimitRequestValidationError) Error

Error satisfies the builtin error interface

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" json:"statuses,omitempty"`
}

A response from a ShouldRateLimit call. [#not-implemented-hide:] Hiding API for now.

func (*RateLimitResponse) Descriptor

func (*RateLimitResponse) Descriptor() ([]byte, []int)

func (*RateLimitResponse) GetOverallCode

func (m *RateLimitResponse) GetOverallCode() RateLimitResponse_Code

func (*RateLimitResponse) GetStatuses

func (*RateLimitResponse) Marshal

func (m *RateLimitResponse) Marshal() (dAtA []byte, err error)

func (*RateLimitResponse) MarshalTo

func (m *RateLimitResponse) MarshalTo(dAtA []byte) (int, error)

func (*RateLimitResponse) ProtoMessage

func (*RateLimitResponse) ProtoMessage()

func (*RateLimitResponse) Reset

func (m *RateLimitResponse) Reset()

func (*RateLimitResponse) Size

func (m *RateLimitResponse) Size() (n int)

func (*RateLimitResponse) String

func (m *RateLimitResponse) String() string

func (*RateLimitResponse) Unmarshal

func (m *RateLimitResponse) Unmarshal(dAtA []byte) error

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, an error is returned.

type RateLimitResponseValidationError

type RateLimitResponseValidationError struct {
	Field  string
	Reason string
	Cause  error
	Key    bool
}

RateLimitResponseValidationError is the validation error returned by RateLimitResponse.Validate if the designated constraints aren't met.

func (RateLimitResponseValidationError) Error

Error satisfies the builtin error interface

type RateLimitResponse_Code

type RateLimitResponse_Code int32
const (
	RateLimitResponse_UNKNOWN    RateLimitResponse_Code = 0
	RateLimitResponse_OK         RateLimitResponse_Code = 1
	RateLimitResponse_OVER_LIMIT RateLimitResponse_Code = 2
)

func (RateLimitResponse_Code) EnumDescriptor

func (RateLimitResponse_Code) EnumDescriptor() ([]byte, []int)

func (RateLimitResponse_Code) String

func (x RateLimitResponse_Code) String() string

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" 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"`
}

func (*RateLimitResponse_DescriptorStatus) Descriptor

func (*RateLimitResponse_DescriptorStatus) Descriptor() ([]byte, []int)

func (*RateLimitResponse_DescriptorStatus) GetCode

func (*RateLimitResponse_DescriptorStatus) GetCurrentLimit

func (*RateLimitResponse_DescriptorStatus) GetLimitRemaining

func (m *RateLimitResponse_DescriptorStatus) GetLimitRemaining() uint32

func (*RateLimitResponse_DescriptorStatus) Marshal

func (m *RateLimitResponse_DescriptorStatus) Marshal() (dAtA []byte, err error)

func (*RateLimitResponse_DescriptorStatus) MarshalTo

func (m *RateLimitResponse_DescriptorStatus) MarshalTo(dAtA []byte) (int, error)

func (*RateLimitResponse_DescriptorStatus) ProtoMessage

func (*RateLimitResponse_DescriptorStatus) ProtoMessage()

func (*RateLimitResponse_DescriptorStatus) Reset

func (*RateLimitResponse_DescriptorStatus) Size

func (*RateLimitResponse_DescriptorStatus) String

func (*RateLimitResponse_DescriptorStatus) Unmarshal

func (m *RateLimitResponse_DescriptorStatus) Unmarshal(dAtA []byte) error

func (*RateLimitResponse_DescriptorStatus) Validate

Validate checks the field values on RateLimitResponse_DescriptorStatus with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RateLimitResponse_DescriptorStatusValidationError

type RateLimitResponse_DescriptorStatusValidationError struct {
	Field  string
	Reason string
	Cause  error
	Key    bool
}

RateLimitResponse_DescriptorStatusValidationError is the validation error returned by RateLimitResponse_DescriptorStatus.Validate if the designated constraints aren't met.

func (RateLimitResponse_DescriptorStatusValidationError) Error

Error satisfies the builtin error interface

type RateLimitResponse_RateLimit

type RateLimitResponse_RateLimit struct {
	RequestsPerUnit uint32                           `protobuf:"varint,1,opt,name=requests_per_unit,json=requestsPerUnit,proto3" json:"requests_per_unit,omitempty"`
	Unit            RateLimitResponse_RateLimit_Unit `` /* 127-byte string literal not displayed */
}

Defines an actual rate limit in terms of requests per unit of time and the unit itself.

func (*RateLimitResponse_RateLimit) Descriptor

func (*RateLimitResponse_RateLimit) Descriptor() ([]byte, []int)

func (*RateLimitResponse_RateLimit) GetRequestsPerUnit

func (m *RateLimitResponse_RateLimit) GetRequestsPerUnit() uint32

func (*RateLimitResponse_RateLimit) GetUnit

func (*RateLimitResponse_RateLimit) Marshal

func (m *RateLimitResponse_RateLimit) Marshal() (dAtA []byte, err error)

func (*RateLimitResponse_RateLimit) MarshalTo

func (m *RateLimitResponse_RateLimit) MarshalTo(dAtA []byte) (int, error)

func (*RateLimitResponse_RateLimit) ProtoMessage

func (*RateLimitResponse_RateLimit) ProtoMessage()

func (*RateLimitResponse_RateLimit) Reset

func (m *RateLimitResponse_RateLimit) Reset()

func (*RateLimitResponse_RateLimit) Size

func (m *RateLimitResponse_RateLimit) Size() (n int)

func (*RateLimitResponse_RateLimit) String

func (m *RateLimitResponse_RateLimit) String() string

func (*RateLimitResponse_RateLimit) Unmarshal

func (m *RateLimitResponse_RateLimit) Unmarshal(dAtA []byte) error

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, an error is returned.

type RateLimitResponse_RateLimitValidationError

type RateLimitResponse_RateLimitValidationError struct {
	Field  string
	Reason string
	Cause  error
	Key    bool
}

RateLimitResponse_RateLimitValidationError is the validation error returned by RateLimitResponse_RateLimit.Validate if the designated constraints aren't met.

func (RateLimitResponse_RateLimitValidationError) Error

Error satisfies the builtin error interface

type RateLimitResponse_RateLimit_Unit

type RateLimitResponse_RateLimit_Unit int32
const (
	RateLimitResponse_RateLimit_UNKNOWN RateLimitResponse_RateLimit_Unit = 0
	RateLimitResponse_RateLimit_SECOND  RateLimitResponse_RateLimit_Unit = 1
	RateLimitResponse_RateLimit_MINUTE  RateLimitResponse_RateLimit_Unit = 2
	RateLimitResponse_RateLimit_HOUR    RateLimitResponse_RateLimit_Unit = 3
	RateLimitResponse_RateLimit_DAY     RateLimitResponse_RateLimit_Unit = 4
)

func (RateLimitResponse_RateLimit_Unit) EnumDescriptor

func (RateLimitResponse_RateLimit_Unit) EnumDescriptor() ([]byte, []int)

func (RateLimitResponse_RateLimit_Unit) String

type RateLimitServiceClient

type RateLimitServiceClient interface {
	// Determine whether rate limiting should take place.
	ShouldRateLimit(ctx context.Context, in *RateLimitRequest, opts ...grpc.CallOption) (*RateLimitResponse, error)
}

func NewRateLimitServiceClient

func NewRateLimitServiceClient(cc *grpc.ClientConn) RateLimitServiceClient

type RateLimitServiceServer

type RateLimitServiceServer interface {
	// Determine whether rate limiting should take place.
	ShouldRateLimit(context.Context, *RateLimitRequest) (*RateLimitResponse, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL