Documentation
¶
Overview ¶
Package net provides a mockable wrapper for net.
Index ¶
- type Impl
- func (*Impl) CIDRMask(ones int, bits int) net.IPMask
- func (*Impl) Dial(network string, address string) (net.Conn, error)
- func (*Impl) DialIP(network string, laddr *net.IPAddr, raddr *net.IPAddr) (*net.IPConn, error)
- func (*Impl) DialTCP(network string, laddr *net.TCPAddr, raddr *net.TCPAddr) (*net.TCPConn, error)
- func (*Impl) DialTimeout(network string, address string, timeout time.Duration) (net.Conn, error)
- func (*Impl) DialUDP(network string, laddr *net.UDPAddr, raddr *net.UDPAddr) (*net.UDPConn, error)
- func (*Impl) DialUnix(network string, laddr *net.UnixAddr, raddr *net.UnixAddr) (*net.UnixConn, error)
- func (*Impl) FileConn(f *os.File) (c net.Conn, err error)
- func (*Impl) FileListener(f *os.File) (ln net.Listener, err error)
- func (*Impl) FilePacketConn(f *os.File) (c net.PacketConn, err error)
- func (*Impl) IPv4(a byte, b byte, c byte, d byte) net.IP
- func (*Impl) IPv4Mask(a byte, b byte, c byte, d byte) net.IPMask
- func (*Impl) InterfaceAddrs() ([]net.Addr, error)
- func (*Impl) InterfaceByIndex(index int) (*net.Interface, error)
- func (*Impl) InterfaceByName(name string) (*net.Interface, error)
- func (*Impl) Interfaces() ([]net.Interface, error)
- func (*Impl) JoinHostPort(host string, port string) string
- func (*Impl) Listen(network string, address string) (net.Listener, error)
- func (*Impl) ListenIP(network string, laddr *net.IPAddr) (*net.IPConn, error)
- func (*Impl) ListenMulticastUDP(network string, ifi *net.Interface, gaddr *net.UDPAddr) (*net.UDPConn, error)
- func (*Impl) ListenPacket(network string, address string) (net.PacketConn, error)
- func (*Impl) ListenTCP(network string, laddr *net.TCPAddr) (*net.TCPListener, error)
- func (*Impl) ListenUDP(network string, laddr *net.UDPAddr) (*net.UDPConn, error)
- func (*Impl) ListenUnix(network string, laddr *net.UnixAddr) (*net.UnixListener, error)
- func (*Impl) ListenUnixgram(network string, laddr *net.UnixAddr) (*net.UnixConn, error)
- func (*Impl) LookupAddr(addr string) (names []string, err error)
- func (*Impl) LookupCNAME(host string) (cname string, err error)
- func (*Impl) LookupHost(host string) (addrs []string, err error)
- func (*Impl) LookupIP(host string) ([]net.IP, error)
- func (*Impl) LookupMX(name string) ([]*net.MX, error)
- func (*Impl) LookupNS(name string) ([]*net.NS, error)
- func (*Impl) LookupPort(network string, service string) (port int, err error)
- func (*Impl) LookupSRV(service string, proto string, name string) (cname string, addrs []*net.SRV, err error)
- func (*Impl) LookupTXT(name string) ([]string, error)
- func (*Impl) ParseCIDR(s string) (net.IP, *net.IPNet, error)
- func (*Impl) ParseIP(s string) net.IP
- func (*Impl) ParseMAC(s string) (hw net.HardwareAddr, err error)
- func (*Impl) Pipe() (net.Conn, net.Conn)
- func (*Impl) ResolveIPAddr(network string, address string) (*net.IPAddr, error)
- func (*Impl) ResolveTCPAddr(network string, address string) (*net.TCPAddr, error)
- func (*Impl) ResolveUDPAddr(network string, address string) (*net.UDPAddr, error)
- func (*Impl) ResolveUnixAddr(network string, address string) (*net.UnixAddr, error)
- func (*Impl) SplitHostPort(hostport string) (host string, port string, err error)
- func (*Impl) TCPAddrFromAddrPort(addr netip.AddrPort) *net.TCPAddr
- func (*Impl) UDPAddrFromAddrPort(addr netip.AddrPort) *net.UDPAddr
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct{}
func (*Impl) DialTimeout ¶
func (*Impl) FilePacketConn ¶
func (*Impl) ListenMulticastUDP ¶
func (*Impl) ListenPacket ¶
func (*Impl) ListenUnix ¶
func (*Impl) ListenUnixgram ¶
func (*Impl) LookupPort ¶
func (*Impl) ResolveIPAddr ¶
func (*Impl) ResolveTCPAddr ¶
func (*Impl) ResolveUDPAddr ¶
func (*Impl) ResolveUnixAddr ¶
func (*Impl) SplitHostPort ¶
func (*Impl) TCPAddrFromAddrPort ¶
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. |
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. |
Click to show internal directories.
Click to hide internal directories.