src

package
v0.0.0-...-0210c54 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

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
}

Jump to

Keyboard shortcuts

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