Documentation
¶
Overview ¶
Package mock simulate a net.Conn with io.ReadWriter
Index ¶
- func New(rw io.ReadWriter) net.Conn
- type Mock
- func (m *Mock) Close() error
- func (m *Mock) LocalAddr() net.Addr
- func (m *Mock) Read(b []byte) (n int, err error)
- func (m *Mock) RemoteAddr() net.Addr
- func (m *Mock) SetDeadline(time.Time) error
- func (m *Mock) SetReadDeadline(time.Time) error
- func (m *Mock) SetWriteDeadline(time.Time) error
- func (m *Mock) Write(b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock a simulate a net.Conn with io.ReadWriter
func (*Mock) RemoteAddr ¶
RemoteAddr returns the remote network address.
func (*Mock) SetDeadline ¶
SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline.
func (*Mock) SetReadDeadline ¶
SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out.
func (*Mock) SetWriteDeadline ¶
SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call. Even if write times out, it may return n > 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out.