Documentation
¶
Overview ¶
Package ratewindow provides bounded, externally synchronized fixed-window counters for peer admission and misbehavior tracking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixedWindow ¶
type FixedWindow struct {
// contains filtered or unexported fields
}
FixedWindow tracks per-peer counts in one shared fixed-duration window. Callers must serialize access to a FixedWindow with their own mutex.
func NewFixedWindow ¶
func NewFixedWindow( window time.Duration, perPeerLimit int, processLimit int, maxPeers int, ) *FixedWindow
NewFixedWindow creates a fixed-window counter. A zero limit disables that limit; maxPeers bounds the number of peer keys retained in one window.
Click to show internal directories.
Click to hide internal directories.