netutil

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultGateway

func GetDefaultGateway(ipv4 bool) (ip net.IP, err error)

func GetDefaultIP

func GetDefaultIP(ipv4 bool, method string) (net.IP, error)

func GetRequestIP

func GetRequestIP(req *http.Request) string

func InetAtoN

func InetAtoN(ip string) int64

InetAtoN convert str ip to int input: 192.168.1.1 output 3232235777

func InetNtoA

func InetNtoA(ip int64) string

InetNtoA convert int ip to str input: 3232235777 output 192.168.1.1

func IsValidIP

func IsValidIP(ip string) bool

func IsValidPort

func IsValidPort(port int) bool

func Reachable added in v1.4.0

func Reachable(protocol string, addr string, timeout time.Duration) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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