net

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DNSNames added in v0.3.0

func DNSNames() (dnsNames []string, err error)

DNSNames returns a default set of machine names. It includes the hostname, and FQDN if the kernel domain name is set. If the kernel domain name is not set, only the hostname is included in the set.

func DomainName added in v0.3.0

func DomainName() (domainname string, err error)

DomainName returns the kernel domain name. If a domain name is not found, an empty string is returned.

func FormatAddress

func FormatAddress(addr string) string

FormatAddress checks that the address has a consistent format.

func IPAddrs

func IPAddrs() (ips []net.IP, err error)

IPAddrs finds and returns a list of non-loopback IPv4 addresses of the current machine.

func NthIPInNetwork added in v0.3.0

func NthIPInNetwork(network *net.IPNet, n int) (net.IP, error)

NthIPInNetwork takes an IPNet and returns the nth IP in it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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