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.
type Operation ¶
type OperationTicker ¶ added in v0.10.0
type OperationTicker struct {
// contains filtered or unexported fields
}
var Ticker *OperationTicker
func (*OperationTicker) GetOnTick ¶ added in v0.10.0
func (ot *OperationTicker) GetOnTick() (fn func())
func (*OperationTicker) SetOnTick ¶ added in v0.10.0
func (ot *OperationTicker) SetOnTick(fn func())
func (*OperationTicker) TickCh ¶ added in v0.10.0
func (ot *OperationTicker) TickCh() (ch <-chan struct{})
Click to show internal directories.
Click to hide internal directories.