Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResponseWrite ¶
func NewResponseWrite(w http.ResponseWriter, r int) http.ResponseWriter
NewResponseWrite 封装ResponseWriter为下载限速模式,rate为限速值,单位byte
例子 w = Newiorate(w, 100*1024) 限制客户端下载速度为100kb
func NewResponseWriteByLimit ¶
func NewResponseWriteByLimit(w http.ResponseWriter, limit *rate.Limiter) http.ResponseWriter
NewResponseWriteByLimit 类似 NewResponseWrite 可传入limiter,便于多个ResponseWrite共用一个限速器,达到全局限速
Types ¶
Click to show internal directories.
Click to hide internal directories.