ip

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(ip uint32) string

Convert 整形转为IP字符串

func GetSegment

func GetSegment(ip string) string

GetSegment 获得ip的网段,例如:192.168.2.102 -> 192.168.2

func IntranetIP

func IntranetIP() (ips []string, err error)

IntranetIP 获取本地局域网ip列表

func IsIPV4

func IsIPV4(ip string) bool

IsIPV4 判断所给地址是否是一个IPv4地址

func IsIntranet

func IsIntranet(ipStr string) bool

IsIntranet 判断所给ip是否为局域网ip A类 10.0.0.0--10.255.255.255 B类 172.16.0.0--172.31.255.255 C类 192.168.0.0--192.168.255.255

func ParseAddress

func ParseAddress(addr string) (string, int)

ParseAddress 解析地址,形如:192.168.1.1:80 -> 192.168.1.1, 80

func ParseUint

func ParseUint(ipstr string) (ip uint32)

ParseUint 字符串转为整形

Types

This section is empty.

Jump to

Keyboard shortcuts

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