ratelimiter

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitInfo

type RateLimitInfo struct {
	Limit      int
	Remaining  int
	ResetAfter time.Duration
	RetryAfter time.Duration
}

type RateLimiter

type RateLimiter struct {
	// contains filtered or unexported fields
}

func New

func New(cfg config.RateLimiter) (*RateLimiter, error)

func (*RateLimiter) RateLimit

func (rl *RateLimiter) RateLimit(key string) (bool, RateLimitInfo, error)

Jump to

Keyboard shortcuts

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