Documentation
¶
Overview ¶
Package testloopback owns deterministic loopback resources used by tests. Production packages must receive the resulting interfaces through their normal dependency-injection seams rather than importing this package.
Index ¶
- Variables
- type Fixture
- type PionAPI
- type TCPListener
- type UDPConn
- func (connection *UDPConn) Close() error
- func (connection *UDPConn) Closed() <-chan struct{}
- func (connection *UDPConn) LocalAddr() net.Addr
- func (connection *UDPConn) ReadFrom(buffer []byte) (int, net.Addr, error)
- func (connection *UDPConn) ReadFromUDP(buffer []byte) (int, *net.UDPAddr, error)
- func (connection *UDPConn) SetDeadline(deadline time.Time) error
- func (connection *UDPConn) SetReadDeadline(deadline time.Time) error
- func (connection *UDPConn) SetWriteDeadline(deadline time.Time) error
- func (connection *UDPConn) WriteTo(buffer []byte, address net.Addr) (int, error)
- func (connection *UDPConn) WriteToUDP(buffer []byte, address *net.UDPAddr) (int, error)
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("loopback fixture is closed")
ErrClosed makes attempts to create resources after cleanup distinguishable from OS bind failures.
Functions ¶
This section is empty.
Types ¶
type Fixture ¶
type Fixture struct {
// contains filtered or unexported fields
}
Fixture is the single cleanup owner for every resource created through it. Reverse-order retirement keeps higher-level Pion owners ahead of the sockets they depend on while still making every close failure part of the test verdict.
func (*Fixture) ListenTCP ¶
func (fixture *Fixture) ListenTCP() *TCPListener
func (*Fixture) NewPionAPI ¶
type PionAPI ¶
type PionAPI struct {
// contains filtered or unexported fields
}
PionAPI owns one held UDP mux and every PeerConnection created through it. Separate logical endpoints should use separate PionAPI values so their ICE candidates describe distinct, continuously-held sockets.
func (*PionAPI) NewPeerConnection ¶
func (api *PionAPI) NewPeerConnection( configuration pion.Configuration, ) (*pion.PeerConnection, error)
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
func (*TCPListener) Addr ¶
func (listener *TCPListener) Addr() net.Addr
func (*TCPListener) Close ¶
func (listener *TCPListener) Close() error
func (*TCPListener) Closed ¶
func (listener *TCPListener) Closed() <-chan struct{}
type UDPConn ¶
type UDPConn struct {
// contains filtered or unexported fields
}