ratelimiter

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRateLimit

func CheckRateLimit(ip IPAddress, limiting settings.CommitRateLimiting) error

Types

type ErrRateLimitExceeded

type ErrRateLimitExceeded struct{}

func (ErrRateLimitExceeded) Error

func (e ErrRateLimitExceeded) Error() string

type Event

type Event struct {
	LastOccurrence int64
}

type IPAddress

type IPAddress string

type RateLimiter

type RateLimiter struct {
	Mu          sync.RWMutex
	RateLimiter map[IPAddress][]Event
}

Jump to

Keyboard shortcuts

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