netutil

package
v0.0.0-...-444a4ab Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2015 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 full hostname with domain

func FullyQualifiedHostnameOrPanic

func FullyQualifiedHostnameOrPanic() string

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

func JoinHostPort

func JoinHostPort(host string, port int) string

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

func ResolveAddr

func ResolveAddr(addr string) (string, error)

ResolveAddr can resolve an address where the host has been left blank, like ":3306".

func ResolveIPv4Addr

func ResolveIPv4Addr(addr string) (string, error)

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

func ResolveIpAddr

func ResolveIpAddr(addr string) (string, error)

ResolveIpAddr 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