Documentation

Overview

Package throttle provides a net.Listener that returns artificially-delayed connections for testing real-world connectivity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	net.Listener
	Down Rate // server Writes to Client
	Up   Rate // server Reads from client
}

func (*Listener) Accept

func (ln *Listener) Accept() (net.Conn, error)

type Rate

type Rate struct {
	KBps    int // or 0, to not rate-limit bandwidth
	Latency time.Duration
}

Source Files