Documentation ¶
Overview ¶
Package cacheqm contains a caching quota.Manager implementation.
Index ¶
Constants ¶
View Source
const ( // DefaultMinBatchSize is the suggested default for minBatchSize. DefaultMinBatchSize = 100 // DefaultMaxCacheEntries is the suggested default for maxEntries. DefaultMaxCacheEntries = 1000 )
Variables ¶
This section is empty.
Functions ¶
func NewCachedManager ¶
NewCachedManager wraps a quota.Manager with an implementation that caches tokens locally.
minBatchSize determines the minimum number of tokens requested from qm for each GetTokens() request.
maxEntries determines the maximum number of cache entries, apart from global quotas. The oldest entries are evicted as necessary, their tokens replenished via PutTokens() to avoid excessive leakage.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.