fakes

package
v0.22.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2024 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCPConn

type TCPConn struct {
	net.Conn
	LAddr net.TCPAddr
	RAddr net.TCPAddr

	Reader io.Reader
	Writer io.Writer
	// contains filtered or unexported fields
}

func (*TCPConn) Close

func (c *TCPConn) Close() error

func (*TCPConn) LocalAddr

func (c *TCPConn) LocalAddr() net.Addr

func (*TCPConn) Read

func (c *TCPConn) Read(p []byte) (n int, err error)

This is connection implementation

func (*TCPConn) RemoteAddr

func (c *TCPConn) RemoteAddr() net.Addr

func (*TCPConn) TestReadConn

func (c *TCPConn) TestReadConn(t testing.TB) []byte

func (*TCPConn) TestRequest

func (c *TCPConn) TestRequest(t testing.TB, data []byte) []byte

func (*TCPConn) TestWriteConn

func (c *TCPConn) TestWriteConn(t testing.TB, data []byte)

func (*TCPConn) Write

func (c *TCPConn) Write(p []byte) (n int, err error)

This is connection implementation

type TCPListener

type TCPListener struct {
	LAddr net.TCPAddr
	Conns chan *TCPConn
}

func (*TCPListener) Accept

func (c *TCPListener) Accept() (net.Conn, error)

Accept waits for and returns the next connection to the listener.

func (*TCPListener) Addr

func (c *TCPListener) Addr() net.Addr

Addr returns the listener's network address.

func (*TCPListener) Close

func (c *TCPListener) Close() error

Close closes the listener. Any blocked Accept operations will be unblocked and return errors.

type TestConnection

type TestConnection interface {
	TestReadConn(t testing.TB) []byte
	TestWriteConn(t testing.TB, data []byte)
	TestRequest(t testing.TB, data []byte) []byte
	LocalAddr() net.Addr
	RemoteAddr() net.Addr
}

type UDPConn

type UDPConn struct {
	net.UDPConn
	LAddr net.UDPAddr
	RAddr net.UDPAddr

	Reader  io.Reader
	Writers map[string]io.Writer
	// contains filtered or unexported fields
}

func (*UDPConn) ExpectAddr

func (c *UDPConn) ExpectAddr(addr net.UDPAddr)

func (*UDPConn) LocalAddr

func (c *UDPConn) LocalAddr() net.Addr

func (*UDPConn) ReadFrom

func (c *UDPConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

This is connection implementation

func (*UDPConn) RemoteAddr

func (c *UDPConn) RemoteAddr() net.Addr

func (*UDPConn) TestReadConn

func (c *UDPConn) TestReadConn(t testing.TB) []byte

func (*UDPConn) TestRequest

func (c *UDPConn) TestRequest(t testing.TB, data []byte) []byte

func (*UDPConn) TestWriteConn

func (c *UDPConn) TestWriteConn(t testing.TB, data []byte)

func (*UDPConn) WriteTo

func (c *UDPConn) WriteTo(p []byte, addr net.Addr) (n int, err error)

This is connection implementation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL