tsrl:通过golang实现HTTP流量整形速率限制

时间:2021-05-19 09:53:30
【文件属性】:
文件名称:tsrl:通过golang实现HTTP流量整形速率限制
文件大小:141KB
文件格式:ZIP
更新时间:2021-05-19 09:53:30
go Go TSRL 它包含两种类型的存储桶:流量整形和速率限制。 Tsrl流量 如何使用 // first access a new buckets pool to manage the buckets pool := New() // get a bucket ,if not exists ,program will create a new bucket ,put it into pool and return bucket := pool.AddBucket("hello", 500, 5*time.Second,model.BUCKET_TYPE_TRAFFIC_SHAPING) // get the token from bucket and do your job token, err := bucket.BorrowToken("key") // when
【文件预览】:
tsrl-master
----README.md(607B)
----cmap()
--------cmap_test.go(420B)
--------concurrent-map.go(8KB)
----pool.go(1KB)
----model()
--------bucket_test.go(1KB)
--------bucket.go(4KB)
----images()
--------logo.png(43KB)
--------tsrl.png(100KB)
----pool_test.go(900B)

网友评论