net

package
v0.0.75 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostIP added in v0.0.20

func GetHostIP() (net.IP, error)

HostIP tries to find an IP that can be used by other machines to reach this machine.

func GetLocalAddrs

func GetLocalAddrs() ([]*net.IPNet, error)

func GetLocalFirstIP

func GetLocalFirstIP() (string, error)

func GetLocalFirstMac

func GetLocalFirstMac() (string, error)

func GetLocalIPs

func GetLocalIPs() ([]string, error)

func GetLocalMacs

func GetLocalMacs() ([]string, error)

func IsIPv4 added in v0.0.61

func IsIPv4(netIP net.IP) bool

IsIPv4 returns if netIP is IPv4.

func IsIPv4String added in v0.0.61

func IsIPv4String(ip string) bool

func LookupHostIPv4 added in v0.0.61

func LookupHostIPv4(host string) (addrs []string, err error)

func ParseIP added in v0.0.61

func ParseIP(s string) net.IP

ParseIP parses s as an IP address, returning the result. The string s can be in IPv4 dotted decimal ("192.0.2.1"), IPv6 ("2001:db8::68"), or IPv4-mapped IPv6 ("::ffff:192.0.2.1") form. If s is not a valid textual representation of an IP address, ParseIP returns nil.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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