netx

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientIP

func ClientIP(r *http.Request) string

func ExtractIP

func ExtractIP(addr net.Addr) net.IP

ExtractIP extract IP from net.Addr

func ExtractPort

func ExtractPort(addr net.Addr) int

ExtractPort extract Port from net.Addr

func GlobalUnicastIP

func GlobalUnicastIP() (net.IP, error)

GlobalUnicastIP get a global unicast IP address

func GlobalUnicastIPString

func GlobalUnicastIPString() (string, error)

GlobalUnicastIPString get a global unicast IP address string

func IPs

func IPs() []net.IP

IPs get all IP addresses

func InterfaceIPs

func InterfaceIPs(name string) ([]net.IP, error)

InterfaceIPs get public IP addresses by interface name

func InterfaceIPv4

func InterfaceIPv4(name string) (net.IP, error)

InterfaceIPv4 get a public IPv4 address

func PickFreePort

func PickFreePort() (int, error)

PickFreePort automatically chose a free port and return it

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