netc

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

GPS 定位计算距离

IP地址

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EarthDistance

func EarthDistance(lat1, lng1, lat2, lng2 float64) float64

func GetExternal

func GetExternal() string

获取外网IP地址

func GetLocalIPAddress

func GetLocalIPAddress() string

获取本地IP地址

func LatitudeLongitudeDistance

func LatitudeLongitudeDistance(lon1, lat1, lon2, lat2 float64) (distance float64)

func ResolveIPV4address

func ResolveIPV4address(ip string) (country, area, city, Isp string, err error)

ResolveIPV4address 解析IPv4 国家、地区、城市、运行商、错误

Types

type IP

type IP struct {
	Country   string `json:"country"`
	CountryId string `json:"country_id"`
	Area      string `json:"area"`
	AreaId    string `json:"area_id"`
	Region    string `json:"region"`
	RegionId  string `json:"region_id"`
	City      string `json:"city"`
	CityId    string `json:"city_id"`
	Isp       string `json:"isp"`
}

type IPInfo

type IPInfo struct {
	Code int `json:"code"`
	Data IP  `json:"data"`
}

type IpApiCom

type IpApiCom struct {
	Status      string  `json:"status"`
	Country     string  `json:"country"`
	CountryCode string  `json:"countryCode"`
	Region      string  `json:"region"`
	RegionName  string  `json:"regionName"`
	City        string  `json:"city"`
	Zip         string  `json:"zip"`
	Lat         float64 `json:"lat"`
	Lon         float64 `json:"lon"`
	Timezone    string  `json:"timezone"`
	Isp         string  `json:"isp"`
	Org         string  `json:"org"`
	As          string  `json:"as"`
	Query       string  `json:"query"`
}

func TaoBaoAPI

func TaoBaoAPI(ip string) *IpApiCom

Jump to

Keyboard shortcuts

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