go-vitess.v1: gopkg.in/src-d/go-vitess.v1/netutil Index | Files

package netutil

import "gopkg.in/src-d/go-vitess.v1/netutil"

Package netutil contains network-related utility functions.


Package Files

conn.go netutil.go

func FullyQualifiedHostname Uses

func FullyQualifiedHostname() (string, error)

FullyQualifiedHostname returns the FQDN of the machine.

func FullyQualifiedHostnameOrPanic Uses

func FullyQualifiedHostnameOrPanic() string

FullyQualifiedHostnameOrPanic is the same as FullyQualifiedHostname but panics in case of an error.

func JoinHostPort Uses

func JoinHostPort(host string, port int32) string

JoinHostPort is an extension to net.JoinHostPort that also formats the integer port.

func ResolveIPv4Addrs Uses

func ResolveIPv4Addrs(addr string) ([]string, error)

ResolveIPv4Addrs resolves the address:port part into IP address:port pairs

func SortRfc2782 Uses

func SortRfc2782(srvs []*net.SRV)

SortRfc2782 reorders SRV records as specified in RFC 2782.

func SplitHostPort Uses

func SplitHostPort(addr string) (string, int, error)

SplitHostPort is an alternative to net.SplitHostPort that also parses the integer port. In addition, it is more tolerant of improperly escaped IPv6 addresses, such as "::1:456", which should actually be "[::1]:456".

type ConnWithTimeouts Uses

type ConnWithTimeouts struct {
    // contains filtered or unexported fields

A ConnWithTimeouts is a wrapper to net.Comm that allows to set a read and write timeouts.

func NewConnWithTimeouts Uses

func NewConnWithTimeouts(conn net.Conn, readTimeout time.Duration, writeTimeout time.Duration) ConnWithTimeouts

NewConnWithTimeouts wraps a net.Conn with read and write deadilnes.

func (ConnWithTimeouts) Read Uses

func (c ConnWithTimeouts) Read(b []byte) (int, error)

Read sets a read deadilne and delegates to conn.Read.

func (ConnWithTimeouts) SetDeadline Uses

func (c ConnWithTimeouts) SetDeadline(t time.Time) error

SetDeadline implements the Conn SetDeadline method.

func (ConnWithTimeouts) SetReadDeadline Uses

func (c ConnWithTimeouts) SetReadDeadline(t time.Time) error

SetReadDeadline implements the Conn SetReadDeadline method.

func (ConnWithTimeouts) SetWriteDeadline Uses

func (c ConnWithTimeouts) SetWriteDeadline(t time.Time) error

SetWriteDeadline implements the Conn SetWriteDeadline method.

func (ConnWithTimeouts) Write Uses

func (c ConnWithTimeouts) Write(b []byte) (int, error)

Write sets a write deadline and delagates to conn.Write

Package netutil imports 8 packages (graph) and is imported by 19 packages. Updated 2019-06-13. Refresh now. Tools for package owners.