Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn interface { net.Conn // SetReadBlock blocks or unblocks the Read method of this Conn. // It reports an error if the existing value matches the new value, // or if the Conn has been Closed. SetReadBlock(bool) error // SetWriteBlock blocks or unblocks the Write method of this Conn. // It reports an error if the existing value matches the new value, // or if the Conn has been Closed. SetWriteBlock(bool) error }
Conn is a net.Conn that can additionally have its reads and writes blocked and unblocked.
type Listener ¶ added in v1.8.0
type Listener struct {
// contains filtered or unexported fields
}
Listener is a net.Listener using NewConn to create pairs of network connections connected in memory using a buffered pipe. It also provides a Dial method to establish new connections.
func (*Listener) Accept ¶ added in v1.8.0
Accept blocks until a new connection is available or the listener is closed.
func (*Listener) Dial ¶ added in v1.8.0
Dial connects to the listener using the provided context. The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected any expiration of the context will not affect the connection.
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
Pipe implements an in-memory FIFO with timeouts.
func (*Pipe) Block ¶
Block will cause all calls to Read and Write to block until they either timeout, are unblocked or the pipe is closed.
func (*Pipe) Read ¶
Read implements io.Reader. Once the buffer is drained (i.e. after Close), subsequent calls will return io.EOF.
func (*Pipe) SetReadDeadline ¶
SetReadDeadline sets the deadline for future Read calls.
func (*Pipe) SetWriteDeadline ¶
SetWriteDeadline sets the deadline for future Write calls.