net

package
v0.0.0-...-fab57c2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package net provides a mockable wrapper for net.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) CIDRMask

func (*Impl) CIDRMask(ones int, bits int) net.IPMask

func (*Impl) Dial

func (*Impl) Dial(network string, address string) (net.Conn, error)

func (*Impl) DialIP

func (*Impl) DialIP(network string, laddr *net.IPAddr, raddr *net.IPAddr) (*net.IPConn, error)

func (*Impl) DialTCP

func (*Impl) DialTCP(network string, laddr *net.TCPAddr, raddr *net.TCPAddr) (*net.TCPConn, error)

func (*Impl) DialTimeout

func (*Impl) DialTimeout(network string, address string, timeout time.Duration) (net.Conn, error)

func (*Impl) DialUDP

func (*Impl) DialUDP(network string, laddr *net.UDPAddr, raddr *net.UDPAddr) (*net.UDPConn, error)

func (*Impl) DialUnix

func (*Impl) DialUnix(network string, laddr *net.UnixAddr, raddr *net.UnixAddr) (*net.UnixConn, error)

func (*Impl) FileConn

func (*Impl) FileConn(f *os.File) (c net.Conn, err error)

func (*Impl) FileListener

func (*Impl) FileListener(f *os.File) (ln net.Listener, err error)

func (*Impl) FilePacketConn

func (*Impl) FilePacketConn(f *os.File) (c net.PacketConn, err error)

func (*Impl) IPv4

func (*Impl) IPv4(a byte, b byte, c byte, d byte) net.IP

func (*Impl) IPv4Mask

func (*Impl) IPv4Mask(a byte, b byte, c byte, d byte) net.IPMask

func (*Impl) InterfaceAddrs

func (*Impl) InterfaceAddrs() ([]net.Addr, error)

func (*Impl) InterfaceByIndex

func (*Impl) InterfaceByIndex(index int) (*net.Interface, error)

func (*Impl) InterfaceByName

func (*Impl) InterfaceByName(name string) (*net.Interface, error)

func (*Impl) Interfaces

func (*Impl) Interfaces() ([]net.Interface, error)

func (*Impl) JoinHostPort

func (*Impl) JoinHostPort(host string, port string) string

func (*Impl) Listen

func (*Impl) Listen(network string, address string) (net.Listener, error)

func (*Impl) ListenIP

func (*Impl) ListenIP(network string, laddr *net.IPAddr) (*net.IPConn, error)

func (*Impl) ListenMulticastUDP

func (*Impl) ListenMulticastUDP(network string, ifi *net.Interface, gaddr *net.UDPAddr) (*net.UDPConn, error)

func (*Impl) ListenPacket

func (*Impl) ListenPacket(network string, address string) (net.PacketConn, error)

func (*Impl) ListenTCP

func (*Impl) ListenTCP(network string, laddr *net.TCPAddr) (*net.TCPListener, error)

func (*Impl) ListenUDP

func (*Impl) ListenUDP(network string, laddr *net.UDPAddr) (*net.UDPConn, error)

func (*Impl) ListenUnix

func (*Impl) ListenUnix(network string, laddr *net.UnixAddr) (*net.UnixListener, error)

func (*Impl) ListenUnixgram

func (*Impl) ListenUnixgram(network string, laddr *net.UnixAddr) (*net.UnixConn, error)

func (*Impl) LookupAddr

func (*Impl) LookupAddr(addr string) (names []string, err error)

func (*Impl) LookupCNAME

func (*Impl) LookupCNAME(host string) (cname string, err error)

func (*Impl) LookupHost

func (*Impl) LookupHost(host string) (addrs []string, err error)

func (*Impl) LookupIP

func (*Impl) LookupIP(host string) ([]net.IP, error)

func (*Impl) LookupMX

func (*Impl) LookupMX(name string) ([]*net.MX, error)

func (*Impl) LookupNS

func (*Impl) LookupNS(name string) ([]*net.NS, error)

func (*Impl) LookupPort

func (*Impl) LookupPort(network string, service string) (port int, err error)

func (*Impl) LookupSRV

func (*Impl) LookupSRV(service string, proto string, name string) (cname string, addrs []*net.SRV, err error)

func (*Impl) LookupTXT

func (*Impl) LookupTXT(name string) ([]string, error)

func (*Impl) ParseCIDR

func (*Impl) ParseCIDR(s string) (net.IP, *net.IPNet, error)

func (*Impl) ParseIP

func (*Impl) ParseIP(s string) net.IP

func (*Impl) ParseMAC

func (*Impl) ParseMAC(s string) (hw net.HardwareAddr, err error)

func (*Impl) Pipe

func (*Impl) Pipe() (net.Conn, net.Conn)

func (*Impl) ResolveIPAddr

func (*Impl) ResolveIPAddr(network string, address string) (*net.IPAddr, error)

func (*Impl) ResolveTCPAddr

func (*Impl) ResolveTCPAddr(network string, address string) (*net.TCPAddr, error)

func (*Impl) ResolveUDPAddr

func (*Impl) ResolveUDPAddr(network string, address string) (*net.UDPAddr, error)

func (*Impl) ResolveUnixAddr

func (*Impl) ResolveUnixAddr(network string, address string) (*net.UnixAddr, error)

func (*Impl) SplitHostPort

func (*Impl) SplitHostPort(hostport string) (host string, port string, err error)

func (*Impl) TCPAddrFromAddrPort

func (*Impl) TCPAddrFromAddrPort(addr netip.AddrPort) *net.TCPAddr

func (*Impl) UDPAddrFromAddrPort

func (*Impl) UDPAddrFromAddrPort(addr netip.AddrPort) *net.UDPAddr

type Interface

type Interface interface {
	CIDRMask(ones int, bits int) net.IPMask
	Dial(network string, address string) (net.Conn, error)
	DialIP(network string, laddr *net.IPAddr, raddr *net.IPAddr) (*net.IPConn, error)
	DialTCP(network string, laddr *net.TCPAddr, raddr *net.TCPAddr) (*net.TCPConn, error)
	DialTimeout(network string, address string, timeout time.Duration) (net.Conn, error)
	DialUDP(network string, laddr *net.UDPAddr, raddr *net.UDPAddr) (*net.UDPConn, error)
	DialUnix(network string, laddr *net.UnixAddr, raddr *net.UnixAddr) (*net.UnixConn, error)
	FileConn(f *os.File) (c net.Conn, err error)
	FileListener(f *os.File) (ln net.Listener, err error)
	FilePacketConn(f *os.File) (c net.PacketConn, err error)
	IPv4(a byte, b byte, c byte, d byte) net.IP
	IPv4Mask(a byte, b byte, c byte, d byte) net.IPMask
	InterfaceAddrs() ([]net.Addr, error)
	InterfaceByIndex(index int) (*net.Interface, error)
	InterfaceByName(name string) (*net.Interface, error)
	Interfaces() ([]net.Interface, error)
	JoinHostPort(host string, port string) string
	Listen(network string, address string) (net.Listener, error)
	ListenIP(network string, laddr *net.IPAddr) (*net.IPConn, error)
	ListenMulticastUDP(network string, ifi *net.Interface, gaddr *net.UDPAddr) (*net.UDPConn, error)
	ListenPacket(network string, address string) (net.PacketConn, error)
	ListenTCP(network string, laddr *net.TCPAddr) (*net.TCPListener, error)
	ListenUDP(network string, laddr *net.UDPAddr) (*net.UDPConn, error)
	ListenUnix(network string, laddr *net.UnixAddr) (*net.UnixListener, error)
	ListenUnixgram(network string, laddr *net.UnixAddr) (*net.UnixConn, error)
	LookupAddr(addr string) (names []string, err error)
	LookupCNAME(host string) (cname string, err error)
	LookupHost(host string) (addrs []string, err error)
	LookupIP(host string) ([]net.IP, error)
	LookupMX(name string) ([]*net.MX, error)
	LookupNS(name string) ([]*net.NS, error)
	LookupPort(network string, service string) (port int, err error)
	LookupSRV(service string, proto string, name string) (cname string, addrs []*net.SRV, err error)
	LookupTXT(name string) ([]string, error)
	ParseCIDR(s string) (net.IP, *net.IPNet, error)
	ParseIP(s string) net.IP
	ParseMAC(s string) (hw net.HardwareAddr, err error)
	Pipe() (net.Conn, net.Conn)
	ResolveIPAddr(network string, address string) (*net.IPAddr, error)
	ResolveTCPAddr(network string, address string) (*net.TCPAddr, error)
	ResolveUDPAddr(network string, address string) (*net.UDPAddr, error)
	ResolveUnixAddr(network string, address string) (*net.UnixAddr, error)
	SplitHostPort(hostport string) (host string, port string, err error)
	TCPAddrFromAddrPort(addr netip.AddrPort) *net.TCPAddr
	UDPAddrFromAddrPort(addr netip.AddrPort) *net.UDPAddr
}

Directories

Path Synopsis
Package http provides a mockable wrapper for net/http.
Package http provides a mockable wrapper for net/http.
cgi
Package cgi provides a mockable wrapper for net/http/cgi.
Package cgi provides a mockable wrapper for net/http/cgi.
cookiejar
Package cookiejar provides a mockable wrapper for net/http/cookiejar.
Package cookiejar provides a mockable wrapper for net/http/cookiejar.
fcgi
Package fcgi provides a mockable wrapper for net/http/fcgi.
Package fcgi provides a mockable wrapper for net/http/fcgi.
httptest
Package httptest provides a mockable wrapper for net/http/httptest.
Package httptest provides a mockable wrapper for net/http/httptest.
httptrace
Package httptrace provides a mockable wrapper for net/http/httptrace.
Package httptrace provides a mockable wrapper for net/http/httptrace.
httputil
Package httputil provides a mockable wrapper for net/http/httputil.
Package httputil provides a mockable wrapper for net/http/httputil.
pprof
Package pprof provides a mockable wrapper for net/http/pprof.
Package pprof provides a mockable wrapper for net/http/pprof.
Package mail provides a mockable wrapper for net/mail.
Package mail provides a mockable wrapper for net/mail.
Package netip provides a mockable wrapper for net/netip.
Package netip provides a mockable wrapper for net/netip.
rpc
Package rpc provides a mockable wrapper for net/rpc.
Package rpc provides a mockable wrapper for net/rpc.
jsonrpc
Package jsonrpc provides a mockable wrapper for net/rpc/jsonrpc.
Package jsonrpc provides a mockable wrapper for net/rpc/jsonrpc.
Package smtp provides a mockable wrapper for net/smtp.
Package smtp provides a mockable wrapper for net/smtp.
Package textproto provides a mockable wrapper for net/textproto.
Package textproto provides a mockable wrapper for net/textproto.
Package url provides a mockable wrapper for net/url.
Package url provides a mockable wrapper for net/url.

Jump to

Keyboard shortcuts

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