xnet

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 13

Documentation

Index

Constants

View Source
const StaticLocalIP = "127.0.0.1"

Variables

View Source
var (
	RetryTimes int           = 10
	Interval   time.Duration = time.Second * 5
)

Functions

func ExtractHostPort added in v0.1.1

func ExtractHostPort(addr string) (host string, port uint64, err error)

ExtractHostPort from address

func GetLocalIP

func GetLocalIP(masks ...string) string

GetLocalIP 获取IP地址

func IsLocalIPv4

func IsLocalIPv4(ip net.IP) bool

ipv4:IsLocalIP 检测IP地址是否内网

func IsLocalIPv4Addr

func IsLocalIPv4Addr(ip string) bool

ipv4: IsLocalIP 检测IP地址是否内网

func IsValidIP added in v0.1.1

func IsValidIP(addr string) bool

func Parse

func Parse(addr string) (proto, name string, err error)

解析协议信息(proto://name)

Types

This section is empty.

Jump to

Keyboard shortcuts

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