Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FreeTCPPort ¶
func FreeTCPPort() uint16
FreeTCPPort returns a TCP port that is free on "localhost", or panics if it cannot find a port
func TCPPort ¶
func TCPPort(l NetworkListener) uint16
TCPPort of the listener address. If the listener isn't TCP, this may panic()
Types ¶
type NetworkListener ¶
A NetworkListener is a listener that looks for data on a network address. It is sometimes useful in testing to get this address so you can talk to it directly.
type TrackingDialer ¶
TrackingDialer remembers connections it's made and allows users to close them
func (*TrackingDialer) Close ¶
func (t *TrackingDialer) Close() error
Close all stored connections. Returns an error on the first close that fails
func (*TrackingDialer) DialTimeout ¶
func (t *TrackingDialer) DialTimeout(network, address string, timeout time.Duration) (net.Conn, error)
DialTimeout simulates net.DialTimeout
Click to show internal directories.
Click to hide internal directories.