文件名称:shapeio:Golang io.Reader和io.Writer的流量整形器
文件大小:5KB
文件格式:ZIP
更新时间:2024-05-29 07:32:13
go golang traffic-shaping Go
形状 Golang io.Reader和io.Writer的流量整形器 import "github.com/fujiwara/shapeio" func ExampleReader () { // example for downloading http body with rate limit. resp , _ := http . Get ( "http://example.com" ) defer resp . Body . Close () reader := shapeio . NewReader ( resp . Body ) reader . SetRateLimit ( 1024 * 10 ) // 10KB/sec io . Copy ( ioutil . Discard , reader ) } func ExampleWriter () { // ex
【文件预览】:
shapeio-master
----shapeio.go(2KB)
----go.mod(149B)
----.github()
--------FUNDING.yml(66B)
--------workflows()
----go.sum(386B)
----LICENSE(1KB)
----shapeio_test.go(2KB)
----README.md(2KB)
----.gitignore(266B)