Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LimiterStore ¶ added in v1.6.1
type LimiterStore struct {
// contains filtered or unexported fields
}
LimiterStore is a specialized store for rate limiters It uses a simple circular buffer approach to avoid expensive evictions
func NewLimiterStore ¶ added in v1.6.1
func NewLimiterStore(maxSize, rateLimit int) *LimiterStore
NewLimiterStore creates a new limiter store
func (*LimiterStore) Cleanup ¶ added in v1.6.1
func (s *LimiterStore) Cleanup(olderThan time.Duration)
Cleanup removes entries older than duration
func (*LimiterStore) Get ¶ added in v1.6.1
func (s *LimiterStore) Get(key uint64) *limiter
Get retrieves or creates a limiter for the given key
func (*LimiterStore) Len ¶ added in v1.6.1
func (s *LimiterStore) Len() int
Len returns the number of limiters
Click to show internal directories.
Click to hide internal directories.