ip

package
v0.0.0-...-0090c64 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IpUtil

type IpUtil struct{}

func (IpUtil) GetLocal

func (iu IpUtil) GetLocal() string

获取当前本地使用的主IP地址

func (IpUtil) GetLocalIpV4

func (iu IpUtil) GetLocalIpV4() string

getLocalIpV4 获取 IPV4 IP,没有则返回空 有返回虚拟网卡的风险

func (IpUtil) IsPortAvailable

func (iu IpUtil) IsPortAvailable(port string) bool

判断指定端口是否空闲,空闲返回true 利用Go标准库中的net包和错误处理来判断端口是否可用

func (IpUtil) RemoteIp

func (iu IpUtil) RemoteIp(req *http.Request) string

获取请求中的IP

Jump to

Keyboard shortcuts

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