iputils

package
v1.0.0-beta.0.rc Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: GPL-3.0 Imports: 2 Imported by: 11

Documentation

Overview

Package iputils contains useful functions for ip address formatting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExternalIP added in v1.0.0

func ExternalIP() (string, error)

ExternalIP returns the first IPv4/IPv6 available.

func ExternalIPv4

func ExternalIPv4() (string, error)

ExternalIPv4 returns the first IPv4 available.

func ExternalIPv6 added in v1.0.0

func ExternalIPv6() (string, error)

ExternalIPv6 retrieves any allocated IPv6 addresses from the accessible network interfaces.

func SortAddresses added in v1.0.0

func SortAddresses(ipAddrs []net.IP) []net.IP

SortAddresses sorts a set of addresses in the order of ipv4 -> ipv6.

Types

This section is empty.

Jump to

Keyboard shortcuts

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