Documentation
¶
Overview ¶
Package rkgrpctimeout is a middleware of grpc framework for timing out request.
Index ¶
Constants ¶
View Source
const ( TokenBucket = "tokenBucket" LeakyBucket = "leakyBucket" DefaultLimit = 1000000 GlobalLimiter = "rk-limiter" )
Variables ¶
This section is empty.
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor
StreamServerInterceptor Add rate limit interceptors.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor
UnaryServerInterceptor Add rate limit interceptors.
Types ¶
type Option ¶
type Option func(*optionSet)
Option option for optionSet
func WithEntryNameAndType ¶
WithEntryNameAndType Provide entry name and entry type.
func WithTimeoutAndResp ¶
WithTimeoutAndResp Provide global timeout and response handler. If response is nil, default globalResponse will be assigned
Click to show internal directories.
Click to hide internal directories.