Documentation
¶
Index ¶
- func ClientIP(req *http.Request) string
- func ClientPublicIP(req *http.Request) string
- func ContentType(req *http.Request) string
- func HasLocalIPAddr(ip string) bool
- func HasLocalIp(ip net.IP) bool
- func IsWebsocket(req *http.Request) bool
- func LongToIP(i uint) (net.IP, error)
- func LongToIPString(i uint) (string, error)
- func RemoteIP(req *http.Request) string
- func StringToLong(ip string) (uint, error)
- func ToLong(ip net.IP) (uint, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientPublicIP ¶
ClientPublicIP 获取客户端的公网 IP 地址,排除本地地址
func ContentType ¶
ContentType 返回请求的 Content-Type 头部,并过滤掉参数部分
func HasLocalIPAddr ¶
HasLocalIPAddr 检查给定的 IP 字符串是否为本地地址(回环、链路本地单播或多播)
func LongToIPString ¶
LongToIPString 将无符号整数表示的 IPv4 地址转换为标准的点分十进制字符串格式
func StringToLong ¶
StringToLong 将 IPv4 地址字符串转换为无符号整数表示形式
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.