Documentation ¶
Overview ¶
Package ciol 实现 net.conn 网络io限速器接口
Index ¶
- Constants
- type Conn
- func (sf *Conn) Close() (err error)
- func (sf *Conn) Read(p []byte) (int, error)
- func (sf *Conn) ReadLimit() rate.Limit
- func (sf *Conn) SetReadBurst(newBurst int)
- func (sf *Conn) SetReadBurstAt(now time.Time, newBurst int)
- func (sf *Conn) SetReadLimit(newLimit rate.Limit)
- func (sf *Conn) SetReadLimitAt(now time.Time, newLimit rate.Limit)
- func (sf *Conn) SetWriteBurst(newBurst int)
- func (sf *Conn) SetWriteBurstAt(now time.Time, newBurst int)
- func (sf *Conn) SetWriteLimit(newLimit rate.Limit)
- func (sf *Conn) SetWriteLimitAt(now time.Time, newLimit rate.Limit)
- func (sf *Conn) Write(p []byte) (int, error)
- func (sf *Conn) WriteLimit() rate.Limit
- type Options
Constants ¶
const MaxBurst = 1000 * 1000 * 1000
MaxBurst 默认读写最大容量限制
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn limiter conn
func New ¶
New new a rate limit (bytes/sec) with option to the Conn read and write. if not set,it will not any limit
func (*Conn) SetReadBurst ¶
SetReadBurst sets a new read burst size for the limiter.
func (*Conn) SetReadBurstAt ¶
SetReadBurstAt sets a new read read size for the limiter.
func (*Conn) SetReadLimit ¶
SetReadLimit sets a new read Limit for the limiter.
func (*Conn) SetReadLimitAt ¶
SetReadLimitAt sets a new read Limit for the limiter.
func (*Conn) SetWriteBurst ¶
SetWriteBurst sets a new read write size for the limiter.
func (*Conn) SetWriteBurstAt ¶
SetWriteBurstAt sets a new read write size for the limiter.
func (*Conn) SetWriteLimit ¶
SetWriteLimit sets a new write Limit for the limiter.
func (*Conn) SetWriteLimitAt ¶
SetWriteLimitAt sets a new write Limit for the limiter.
func (*Conn) WriteLimit ¶
WriteLimit returns the maximum overall event write rate.