ratelimit

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The rate limiting options for this method.
	//
	// repeated ratelimit.RateLimitOptions options = 50000;
	E_Options = &file_ratelimit_ratelimit_proto_extTypes[0]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var File_ratelimit_ratelimit_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type RateLimitOptions

type RateLimitOptions struct {

	// The maximum number of requests that can be per minute.
	Limit uint64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	// The metadata key to use for rate limiting - if the key is not present in the metadata, the request will not be rate limited.
	MetadataKey string `protobuf:"bytes,2,opt,name=metadata_key,json=metadataKey,proto3" json:"metadata_key,omitempty"`
	// The message to return when the rate limit is exceeded(Defaults to "Rate limit exceeded").
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

The options for rate limiting a method.

func (*RateLimitOptions) Descriptor deprecated

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

Deprecated: Use RateLimitOptions.ProtoReflect.Descriptor instead.

func (*RateLimitOptions) GetLimit

func (x *RateLimitOptions) GetLimit() uint64

func (*RateLimitOptions) GetMessage

func (x *RateLimitOptions) GetMessage() string

func (*RateLimitOptions) GetMetadataKey

func (x *RateLimitOptions) GetMetadataKey() string

func (*RateLimitOptions) ProtoMessage

func (*RateLimitOptions) ProtoMessage()

func (*RateLimitOptions) ProtoReflect

func (x *RateLimitOptions) ProtoReflect() protoreflect.Message

func (*RateLimitOptions) Reset

func (x *RateLimitOptions) Reset()

func (*RateLimitOptions) String

func (x *RateLimitOptions) String() string

Jump to

Keyboard shortcuts

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