Documentation
¶
Index ¶
- type FuncAddr
- type FuncConn
- func (fc *FuncConn) Close() error
- func (fc *FuncConn) LocalAddr() net.Addr
- func (fc *FuncConn) Read(b []byte) (int, error)
- func (fc *FuncConn) RemoteAddr() net.Addr
- func (fc *FuncConn) SetDeadline(t time.Time) error
- func (fc *FuncConn) SetReadDeadline(t time.Time) error
- func (fc *FuncConn) SetWriteDeadline(t time.Time) error
- func (fc *FuncConn) Write(b []byte) (int, error)
- type FuncDialer
- type FuncListener
- type FuncResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuncConn ¶
type FuncConn struct {
ReadFunc func([]byte) (int, error)
WriteFunc func([]byte) (int, error)
CloseFunc func() error
LocalAddrFunc func() net.Addr
RemoteAddrFunc func() net.Addr
SetDeadlineFunc func(time.Time) error
SetReadDeadFunc func(time.Time) error
SetWriteDeaFunc func(time.Time) error
}
FuncConn allows to mock any net.Conn.
func (*FuncConn) RemoteAddr ¶
RemoteAddr implements net.Conn.
func (*FuncConn) SetDeadline ¶
SetDeadline implements net.Conn.
func (*FuncConn) SetReadDeadline ¶
SetReadDeadline implements net.Conn.
func (*FuncConn) SetWriteDeadline ¶
SetWriteDeadline implements net.Conn.
type FuncDialer ¶
type FuncDialer struct {
DialContextFunc func(ctx context.Context, network, address string) (net.Conn, error)
}
FuncDialer allows to mock any dialer with a DialContext method.
func (*FuncDialer) DialContext ¶
DialContext implements a dialer with a DialContext method.
type FuncListener ¶
type FuncListener struct {
AcceptFunc func() (net.Conn, error)
CloseFunc func() error
AddrFunc func() net.Addr
}
FuncListener allows to mock any net.Listener.
func (*FuncListener) Accept ¶
func (fl *FuncListener) Accept() (net.Conn, error)
Accept implements net.Listener.
type FuncResolver ¶
type FuncResolver struct {
LookupHostFunc func(ctx context.Context, name string) ([]string, error)
}
FuncResolver allows to mock any resolver with a LookupHost method.
func (*FuncResolver) LookupHost ¶
LookupHost implements a resolver with a LookupHost method.
Click to show internal directories.
Click to hide internal directories.