Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶ added in v5.3.0
type Limiter struct { // Limit and Burst are read-only. Limit rate.Limit Burst int // contains filtered or unexported fields }
func NewRateLimiter ¶
NewRateLimiter creates a new client rate limiter. limit and burst should be greater than zero. See rate.Limiter for more details. Limiter has a internal gc which will run and remove old client entries every 1m. If the token refill time (burst/limit) is greater than 1m, the actual average qps limit may be higher than expected because the client status may be deleted and re-initialized.
func (*Limiter) Allow ¶ added in v5.3.0
maskedUnmappedP must be a masked prefix and contain a unmapped addr.
Click to show internal directories.
Click to hide internal directories.