Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TokenBucketLimiter ¶
func TokenBucketLimiter(reqPerSec uint64) gin.HandlerFunc
TokenBucketLimiter is a middleware that acts as a rate limiter based on the token bucket algorithm. It takes an integer as an argument, which represents the number of requests per second that the server will allow.
Types ¶
type TokenBucket ¶
type TokenBucket struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.