netutil

package
v2.1.0-alpha.2+incompa... Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2017 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package netutil contains network-related utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullyQualifiedHostname

func FullyQualifiedHostname() (string, error)

FullyQualifiedHostname returns the FQDN of the machine.

func FullyQualifiedHostnameOrPanic

func FullyQualifiedHostnameOrPanic() string

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

func JoinHostPort

func JoinHostPort(host string, port int32) string

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

func ResolveIPv4Addr

func ResolveIPv4Addr(addr string) (string, error)

ResolveIPv4Addr resolves the address:port part into an IP address:port pair

func SortRfc2782

func SortRfc2782(srvs []*net.SRV)

SortRfc2782 reorders SRV records as specified in RFC 2782.

func SplitHostPort

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".

Types

This section is empty.

Jump to

Keyboard shortcuts

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