Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultNetDialer = &net.Dialer{}
Functions ¶
This section is empty.
Types ¶
type DialContextFn ¶ added in v0.3.0
type Dialer ¶
type Dialer struct {
DialContextFn // DialContext function we wrap
*Limiter // Limiter to use
}
type Limiter ¶
func NewLimiter ¶
NewLimiter returns a new limiter. If you provide limits, the first will set both read and write limits, the second will set the write limit.
func (*Limiter) Wrap ¶ added in v0.7.0
func (l *Limiter) Wrap(fn DialContextFn) DialContextFn
Wrap returns a DialContextFn using the given fn that is bandwidth limited by this Limiter. If fn is nil we use DefaultNetDialer.DialContext.
Click to show internal directories.
Click to hide internal directories.