fakenet

package
v3.0.7 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package fakenet contains fake network abstractions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockPacketConn

type MockPacketConn struct{}

MockPacketConn for tests

func (*MockPacketConn) Close

func (m *MockPacketConn) Close() error

func (*MockPacketConn) LocalAddr

func (m *MockPacketConn) LocalAddr() net.Addr

func (*MockPacketConn) ReadFrom

func (m *MockPacketConn) ReadFrom([]byte) (n int, addr net.Addr, err error)

func (*MockPacketConn) SetDeadline

func (m *MockPacketConn) SetDeadline(time.Time) error

func (*MockPacketConn) SetReadDeadline

func (m *MockPacketConn) SetReadDeadline(time.Time) error

func (*MockPacketConn) SetWriteDeadline

func (m *MockPacketConn) SetWriteDeadline(time.Time) error

func (*MockPacketConn) WriteTo

func (m *MockPacketConn) WriteTo([]byte, net.Addr) (n int, err error)

type PacketConn

type PacketConn struct {
	net.Conn
}

PacketConn wraps a net.Conn and emulates net.PacketConn

func (*PacketConn) ReadFrom

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

ReadFrom reads a packet from the connection,

func (*PacketConn) WriteTo

func (f *PacketConn) WriteTo(p []byte, _ net.Addr) (int, error)

WriteTo writes a packet with payload p to addr.

Jump to

Keyboard shortcuts

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