bwlimit

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BwLimit

type BwLimit struct {
	// contains filtered or unexported fields
}

holds info about the rate limiters in use

func (*BwLimit) LimitBandwidth

func (t *BwLimit) LimitBandwidth(n int)

func (*BwLimit) SetBwLimit

func (t *BwLimit) SetBwLimit(bandwidth int64)

SetBwLimit sets the current bandwidth limit

type Dialer

type Dialer struct {
	net.Dialer

	Timeout time.Duration
	// contains filtered or unexported fields
}

Dialer structure contains default dialer and timeout

func NewDialer

func NewDialer() *Dialer

NewDialer creates a Dialer structure with Timeout, Keepalive bandwidth limit rx: read, tx write

func (*Dialer) Dial

func (d *Dialer) Dial(network, address string) (net.Conn, error)

Dial connects to the network address.

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

DialContext connects to the network address using the provided context.

func (*Dialer) RxBwLimit

func (d *Dialer) RxBwLimit() *BwLimit

func (*Dialer) TxBwLimit

func (d *Dialer) TxBwLimit() *BwLimit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL