Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

a rate limiter

License

NotificationsYou must be signed in to change notification settings

aide-family/rate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quick start

go get github.com/aide-family/rate
package mainimport ("fmt""github.com/aide-family/rate""time")funcmain() {// This limiter allows for the generation of 3 tokens within a 10 second window with a minimum interval of 2 seconds.limiter:=rate.NewLimiter(3,10*time.Second,2*time.Second)iflimiter.Allow() {fmt.Println("allow")}else{fmt.Println("not allow")    }}

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp