netutil

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectHostIPv4

func DetectHostIPv4() (string, error)

DetectHostIPv4 attempts to determine the host IPv4 address by finding the first non-loopback device with an assigned IPv4 address.

func FixUnspecifiedHostAddr

func FixUnspecifiedHostAddr(addr string) (string, error)

func IsRoutableIPv4 added in v0.1.11

func IsRoutableIPv4(s string) bool

IsRoutableIP checks that the passed string can be parsed in to a valid IPv4 address, and that it is not a loopback or unspecified address that would not be reachable outside of that host device.

func SplitHostPort

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

Types

type Address

type Address struct {
	Host string
	Port int
}

func ParseAddr

func ParseAddr(addr string) (*Address, error)

func (*Address) IsUnspecified

func (a *Address) IsUnspecified() bool

func (*Address) String

func (a *Address) String() string

Jump to

Keyboard shortcuts

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