package
Version:
v0.9.7-rc2
Opens a new window with list of versions in this module.
Published: Jun 18, 2021
License: Apache-2.0, MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Limiter is used to restrict access to a resources till a future time
NewLimiter returns a new limiter
Add limits value till a given time
Clean removes all values which a call to Ready would return true
Clear removes value from the limiter. Any calls to Ready for the value
will return true after a call to Clear for it.
Ready checks to see if the time has expired. Returns a time.Duration
for the time remaining till a true value will be returned
Time interface defines required time methods for the Limiter struct.
Primarily used for testing
Source Files
¶
Click to show internal directories.
Click to hide internal directories.