type NetListenOptions … // NetListener returns a new Listener that listens on a socket using the net package. func NetListener(ctx context.Context, network, address string, options NetListenOptions) (Listener, error) { … } type netListener … // Accept blocks waiting for an incoming connection to the listener. func (l *netListener) Accept(context.Context) (io.ReadWriteCloser, error) { … } // Close will cause the listener to stop listening. It will not close any connections that have // already been accepted. func (l *netListener) Close() error { … } // Dialer returns a dialer that can be used to connect to the listener. func (l *netListener) Dialer() Dialer { … } // NetDialer returns a Dialer using the supplied standard network dialer. func NetDialer(network, address string, nd net.Dialer) Dialer { … } type netDialer … func (n *netDialer) Dial(ctx context.Context) (io.ReadWriteCloser, error) { … } // NetPipeListener returns a new Listener that listens using net.Pipe. // It is only possibly to connect to it using the Dialer returned by the // Dialer method, each call to that method will generate a new pipe the other // side of which will be returned from the Accept call. func NetPipeListener(ctx context.Context) (Listener, error) { … } type netPiper … // Accept blocks waiting for an incoming connection to the listener. func (l *netPiper) Accept(context.Context) (io.ReadWriteCloser, error) { … } // Close will cause the listener to stop listening. It will not close any connections that have // already been accepted. func (l *netPiper) Close() error { … } func (l *netPiper) Dialer() Dialer { … } func (l *netPiper) Dial(ctx context.Context) (io.ReadWriteCloser, error) { … }