Discover Packages
github.com/qydysky/part
limit
package
Version:
v0.5.10
Opens a new window with list of versions in this module.
Published: Apr 24, 2021
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 6
Opens a new window with list of known importers.
Documentation
Documentation
¶
func New(maxNum_in_period, ms_in_period, ms_to_timeout int ) *Limit
create a Limit Object
it will allow maxNum_in_period requests(call TO()) in ms_in_period. if the request(call TO()) is out of maxNum_in_period,it will wait ms_to_timeout
return the token number of bucket at previous
return the token number of bucket at now
the func will return true if the request(call TO()) is up to limit and return false if not
Source Files
¶
Click to show internal directories.
Click to hide internal directories.