Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a sliding window counter implemented with a TTL cache
func (*Counter) DeleteExpired ¶
func (c *Counter) DeleteExpired()
DeleteExpired deletes expired items from the cache
type Option ¶
type Option func(*Counter)
func DisableAutoDeleteExpired ¶
func DisableAutoDeleteExpired() Option
DisableAutoDeleteExpired disables the automatic deletion of expired items
func WithCapacity ¶
WithCapacity sets the maximum number of items to store in the cache
Click to show internal directories.
Click to hide internal directories.