Versions in this module Expand all Collapse all v1 v1.3.3 Oct 2, 2014 v1.3.1 Aug 21, 2014 Changes in this version + const IPv4len + const IPv6len + var ErrWriteToConnected = errors.New("use of WriteTo with pre-connected connection") + var IPv4allrouter = IPv4(224, 0, 0, 2) + var IPv4allsys = IPv4(224, 0, 0, 1) + var IPv4bcast = IPv4(255, 255, 255, 255) + var IPv4zero = IPv4(0, 0, 0, 0) + var IPv6interfacelocalallnodes = IP + var IPv6linklocalallnodes = IP + var IPv6linklocalallrouters = IP + var IPv6loopback = IP + var IPv6unspecified = IP + var IPv6zero = IP + func JoinHostPort(host, port string) string + func LookupAddr(addr string) (name []string, err error) + func LookupCNAME(name string) (cname string, err error) + func LookupHost(host string) (addrs []string, err error) + func LookupPort(network, service string) (port int, err error) + func LookupTXT(name string) (txt []string, err error) + func ParseCIDR(s string) (IP, *IPNet, error) + func Pipe() (Conn, Conn) + func SplitHostPort(hostport string) (host, port string, err error) + type Addr interface + Network func() string + String func() string + func InterfaceAddrs() ([]Addr, error) + type AddrError struct + Addr string + Err string + func (e *AddrError) Error() string + func (e *AddrError) Temporary() bool + func (e *AddrError) Timeout() bool + type Conn interface + Close func() error + LocalAddr func() Addr + Read func(b []byte) (n int, err error) + RemoteAddr func() Addr + SetDeadline func(t time.Time) error + SetReadDeadline func(t time.Time) error + SetWriteDeadline func(t time.Time) error + Write func(b []byte) (n int, err error) + func Dial(network, address string) (Conn, error) + func DialTimeout(network, address string, timeout time.Duration) (Conn, error) + func FileConn(f *os.File) (c Conn, err error) + type DNSConfigError struct + Err error + func (e *DNSConfigError) Error() string + func (e *DNSConfigError) Temporary() bool + func (e *DNSConfigError) Timeout() bool + type DNSError struct + Err string + IsTimeout bool + Name string + Server string + func (e *DNSError) Error() string + func (e *DNSError) Temporary() bool + func (e *DNSError) Timeout() bool + type Dialer struct + Deadline time.Time + DualStack bool + KeepAlive time.Duration + LocalAddr Addr + Timeout time.Duration + func (d *Dialer) Dial(network, address string) (Conn, error) + type Error interface + Temporary func() bool + Timeout func() bool + type Flags uint + const FlagBroadcast + const FlagLoopback + const FlagMulticast + const FlagPointToPoint + const FlagUp + func (f Flags) String() string + type HardwareAddr []byte + func ParseMAC(s string) (hw HardwareAddr, err error) + func (a HardwareAddr) String() string + type IP []byte + func IPv4(a, b, c, d byte) IP + func LookupIP(host string) (addrs []IP, err error) + func ParseIP(s string) IP + func (ip *IP) UnmarshalText(text []byte) error + func (ip IP) DefaultMask() IPMask + func (ip IP) Equal(x IP) bool + func (ip IP) IsGlobalUnicast() bool + func (ip IP) IsInterfaceLocalMulticast() bool + func (ip IP) IsLinkLocalMulticast() bool + func (ip IP) IsLinkLocalUnicast() bool + func (ip IP) IsLoopback() bool + func (ip IP) IsMulticast() bool + func (ip IP) IsUnspecified() bool + func (ip IP) MarshalText() ([]byte, error) + func (ip IP) Mask(mask IPMask) IP + func (ip IP) String() string + func (ip IP) To16() IP + func (ip IP) To4() IP + type IPAddr struct + IP IP + Zone string + func ResolveIPAddr(net, addr string) (*IPAddr, error) + func (a *IPAddr) Network() string + func (a *IPAddr) String() string + type IPConn struct — darwin/amd64, linux/amd64, windows/amd64 + func DialIP(netProto string, laddr, raddr *IPAddr) (*IPConn, error) + func ListenIP(netProto string, laddr *IPAddr) (*IPConn, error) + func (c *IPConn) Close() error + func (c *IPConn) File() (f *os.File, err error) + func (c *IPConn) LocalAddr() Addr + func (c *IPConn) Read(b []byte) (int, error) + func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) + func (c *IPConn) ReadFromIP(b []byte) (int, *IPAddr, error) + func (c *IPConn) ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *IPAddr, err error) + func (c *IPConn) RemoteAddr() Addr + func (c *IPConn) SetDeadline(t time.Time) error + func (c *IPConn) SetReadBuffer(bytes int) error + func (c *IPConn) SetReadDeadline(t time.Time) error + func (c *IPConn) SetWriteBuffer(bytes int) error + func (c *IPConn) SetWriteDeadline(t time.Time) error + func (c *IPConn) Write(b []byte) (int, error) + func (c *IPConn) WriteMsgIP(b, oob []byte, addr *IPAddr) (n, oobn int, err error) + func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error) + func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) + type IPMask []byte + func CIDRMask(ones, bits int) IPMask + func IPv4Mask(a, b, c, d byte) IPMask + func (m IPMask) Size() (ones, bits int) + func (m IPMask) String() string + type IPNet struct + IP IP + Mask IPMask + func (n *IPNet) Contains(ip IP) bool + func (n *IPNet) Network() string + func (n *IPNet) String() string + type Interface struct + Flags Flags + HardwareAddr HardwareAddr + Index int + MTU int + Name string + func InterfaceByIndex(index int) (*Interface, error) + func InterfaceByName(name string) (*Interface, error) + func Interfaces() ([]Interface, error) + func (ifi *Interface) Addrs() ([]Addr, error) + func (ifi *Interface) MulticastAddrs() ([]Addr, error) + type InvalidAddrError string + func (e InvalidAddrError) Error() string + func (e InvalidAddrError) Temporary() bool + func (e InvalidAddrError) Timeout() bool + type Listener interface + Accept func() (c Conn, err error) + Addr func() Addr + Close func() error + func FileListener(f *os.File) (l Listener, err error) + func Listen(net, laddr string) (Listener, error) + type MX struct + Host string + Pref uint16 + func LookupMX(name string) (mx []*MX, err error) + type NS struct + Host string + func LookupNS(name string) (ns []*NS, err error) + type OpError struct + Addr Addr + Err error + Net string + Op string + func (e *OpError) Error() string + func (e *OpError) Temporary() bool + func (e *OpError) Timeout() bool + type PacketConn interface + Close func() error + LocalAddr func() Addr + ReadFrom func(b []byte) (n int, addr Addr, err error) + SetDeadline func(t time.Time) error + SetReadDeadline func(t time.Time) error + SetWriteDeadline func(t time.Time) error + WriteTo func(b []byte, addr Addr) (n int, err error) + func FilePacketConn(f *os.File) (c PacketConn, err error) + func ListenPacket(net, laddr string) (PacketConn, error) + type ParseError struct + Text string + Type string + func (e *ParseError) Error() string + type SRV struct + Port uint16 + Priority uint16 + Target string + Weight uint16 + func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) + type TCPAddr struct + IP IP + Port int + Zone string + func ResolveTCPAddr(net, addr string) (*TCPAddr, error) + func (a *TCPAddr) Network() string + func (a *TCPAddr) String() string + type TCPConn struct — darwin/amd64, linux/amd64, windows/amd64 + func DialTCP(net string, laddr, raddr *TCPAddr) (*TCPConn, error) + func (c *TCPConn) Close() error + func (c *TCPConn) CloseRead() error + func (c *TCPConn) CloseWrite() error + func (c *TCPConn) File() (f *os.File, err error) + func (c *TCPConn) LocalAddr() Addr + func (c *TCPConn) Read(b []byte) (int, error) + func (c *TCPConn) ReadFrom(r io.Reader) (int64, error) + func (c *TCPConn) RemoteAddr() Addr + func (c *TCPConn) SetDeadline(t time.Time) error + func (c *TCPConn) SetKeepAlive(keepalive bool) error + func (c *TCPConn) SetKeepAlivePeriod(d time.Duration) error + func (c *TCPConn) SetLinger(sec int) error + func (c *TCPConn) SetNoDelay(noDelay bool) error + func (c *TCPConn) SetReadBuffer(bytes int) error + func (c *TCPConn) SetReadDeadline(t time.Time) error + func (c *TCPConn) SetWriteBuffer(bytes int) error + func (c *TCPConn) SetWriteDeadline(t time.Time) error + func (c *TCPConn) Write(b []byte) (int, error) + type TCPListener struct — darwin/amd64, linux/amd64, windows/amd64 + func ListenTCP(net string, laddr *TCPAddr) (*TCPListener, error) + func (l *TCPListener) Accept() (Conn, error) + func (l *TCPListener) AcceptTCP() (*TCPConn, error) + func (l *TCPListener) Addr() Addr + func (l *TCPListener) Close() error + func (l *TCPListener) File() (f *os.File, err error) + func (l *TCPListener) SetDeadline(t time.Time) error + type UDPAddr struct + IP IP + Port int + Zone string + func ResolveUDPAddr(net, addr string) (*UDPAddr, error) + func (a *UDPAddr) Network() string + func (a *UDPAddr) String() string + type UDPConn struct — darwin/amd64, linux/amd64, windows/amd64 + func DialUDP(net string, laddr, raddr *UDPAddr) (*UDPConn, error) + func ListenMulticastUDP(net string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, error) + func ListenUDP(net string, laddr *UDPAddr) (*UDPConn, error) + func (c *UDPConn) Close() error + func (c *UDPConn) File() (f *os.File, err error) + func (c *UDPConn) LocalAddr() Addr + func (c *UDPConn) Read(b []byte) (int, error) + func (c *UDPConn) ReadFrom(b []byte) (int, Addr, error) + func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err error) + func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *UDPAddr, err error) + func (c *UDPConn) RemoteAddr() Addr + func (c *UDPConn) SetDeadline(t time.Time) error + func (c *UDPConn) SetReadBuffer(bytes int) error + func (c *UDPConn) SetReadDeadline(t time.Time) error + func (c *UDPConn) SetWriteBuffer(bytes int) error + func (c *UDPConn) SetWriteDeadline(t time.Time) error + func (c *UDPConn) Write(b []byte) (int, error) + func (c *UDPConn) WriteMsgUDP(b, oob []byte, addr *UDPAddr) (n, oobn int, err error) + func (c *UDPConn) WriteTo(b []byte, addr Addr) (int, error) + func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (int, error) + type UnixAddr struct + Name string + Net string + func ResolveUnixAddr(net, addr string) (*UnixAddr, error) + func (a *UnixAddr) Network() string + func (a *UnixAddr) String() string + type UnixConn struct — darwin/amd64, linux/amd64, windows/amd64 + func DialUnix(net string, laddr, raddr *UnixAddr) (*UnixConn, error) + func ListenUnixgram(net string, laddr *UnixAddr) (*UnixConn, error) + func (c *UnixConn) Close() error + func (c *UnixConn) CloseRead() error + func (c *UnixConn) CloseWrite() error + func (c *UnixConn) File() (f *os.File, err error) + func (c *UnixConn) LocalAddr() Addr + func (c *UnixConn) Read(b []byte) (int, error) + func (c *UnixConn) ReadFrom(b []byte) (int, Addr, error) + func (c *UnixConn) ReadFromUnix(b []byte) (n int, addr *UnixAddr, err error) + func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAddr, err error) + func (c *UnixConn) RemoteAddr() Addr + func (c *UnixConn) SetDeadline(t time.Time) error + func (c *UnixConn) SetReadBuffer(bytes int) error + func (c *UnixConn) SetReadDeadline(t time.Time) error + func (c *UnixConn) SetWriteBuffer(bytes int) error + func (c *UnixConn) SetWriteDeadline(t time.Time) error + func (c *UnixConn) Write(b []byte) (int, error) + func (c *UnixConn) WriteMsgUnix(b, oob []byte, addr *UnixAddr) (n, oobn int, err error) + func (c *UnixConn) WriteTo(b []byte, addr Addr) (n int, err error) + func (c *UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (n int, err error) + type UnixListener struct — darwin/amd64, linux/amd64, windows/amd64 + func ListenUnix(net string, laddr *UnixAddr) (*UnixListener, error) + func (l *UnixListener) Accept() (c Conn, err error) + func (l *UnixListener) AcceptUnix() (*UnixConn, error) + func (l *UnixListener) Addr() Addr + func (l *UnixListener) Close() error + func (l *UnixListener) File() (f *os.File, err error) + func (l *UnixListener) SetDeadline(t time.Time) (err error) + type UnknownNetworkError string + func (e UnknownNetworkError) Error() string + func (e UnknownNetworkError) Temporary() bool + func (e UnknownNetworkError) Timeout() bool