Documentation
¶
Overview ¶
Package mocks contains mocks for standard library types.
Index ¶
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (int, error)
- type HTTPTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { // MockRead is the function to call when Read is called. MockRead func(b []byte) (int, error) // MockWrite is the function to call when Write is called. MockWrite func(b []byte) (int, error) // MockClose is the function to call when Close is called. MockClose func() error // MockLocalAddr is the function to call when LocalAddr is called. MockLocalAddr func() net.Addr // MockRemoteAddr is the function to call when RemoteAddr is called. MockRemoteAddr func() net.Addr // MockSetDeadline is the function to call when SetDeadline is called. MockSetDeadline func(t time.Time) error // MockSetReadDeadline is the function to call when SetReadDeadline is called. MockSetReadDeadline func(t time.Time) error // MockSetWriteDeadline is the function to call when SetWriteDeadline is called. MockSetWriteDeadline func(t time.Time) error }
Conn is a mockable net.Conn.
func (*Conn) SetDeadline ¶
SetDeadline calls MockSetDeadline.
func (*Conn) SetReadDeadline ¶
SetReadDeadline calls MockSetReadDeadline.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline calls MockSetWriteDeadline.
type HTTPTransport ¶
type HTTPTransport struct { // MockRoundTrip is the function to call when RoundTrip is called. MockRoundTrip func(req *http.Request) (*http.Response, error) }
HTTPTransport mocks http.RoundTripper.
Click to show internal directories.
Click to hide internal directories.