Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsIPInCIDR ¶ added in v1.2.176
func PrintIPRange ¶ added in v1.2.176
PrintIPRange 打印指定 CIDR 范围内的所有 IP
Types ¶
type CIDR ¶ added in v1.2.176
type CIDR struct { Network string FirstIP string LastIP string Total uint64 Netmask string Wildcard string IPVersion string }
func CalculateCIDR ¶ added in v1.2.176
type GoIp ¶
type GoIp struct { IpServiceUrl string // contains filtered or unexported fields }
func (*GoIp) GetIpLocation ¶ added in v1.2.88
获取IP地址的地理位置信息 需要提供IpServiceUrl
func (*GoIp) QueryDbReaderCountryForZhName ¶
查询 IP相关信息,返回IP所属国家中文名称
func (*GoIp) QueryLocationInfoByIp ¶
func (g *GoIp) QueryLocationInfoByIp(ipStr string) (*IP2Locationrecord, error)
IP 相关信息
type IP2Locationrecord ¶
type IP2Locationrecord struct { Country_short string Country_long string Region string City string Isp string Latitude float32 Longitude float32 Domain string Zipcode string Timezone string Netspeed string Iddcode string Areacode string Weatherstationcode string Weatherstationname string Mcc string Mnc string Mobilebrand string Elevation float32 Usagetype string Addresstype string Category string District string Asn string As string }
type IpLocation ¶ added in v1.2.88
type IpLocation struct { IsoCode string `json:"iso_code"` //iso 编码 https://zh.m.wikipedia.org/zh/ISO_3166-1 Name string `json:"name"` Continent string `json:"continent"` //洲 ContinentCode string `json:"continent_code"` //洲编码 Isp string `json:"isp"` //isp }
----------------------------------------------------------------
Click to show internal directories.
Click to hide internal directories.