usage

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimiter

type RateLimiter limiter.Store

RateLimiter is an interface use to apply rate limiting

func NewRateLimiter

func NewRateLimiter(conf RateLimitingConfig) (RateLimiter, error)

NewRateLimiter create new rate limiter

type RateLimitingConfig

type RateLimitingConfig struct {
	// Provider of the rate limiting store
	Provider string `toml:"provider"`
	// Tokens allowed per interval
	Tokens int `toml:"tokens"`
	// Interval until tokens reset
	Interval string `toml:"interval"`
}

RateLimiterConfig for rate-limiter configuration section

Jump to

Keyboard shortcuts

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