ipinfo

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPublicIP

func GetPublicIP() (string, error)

GetPublicIP 获取本机公网 IP

Types

type IPResponse

type IPResponse struct {
	Query      string `json:"query"`
	Country    string `json:"country"`
	RegionName string `json:"regionName"`
	City       string `json:"city"`
	ISP        string `json:"isp"`
	Status     string `json:"status"`
	Message    string `json:"message"` // 失败时返回
}

IPResponse 用于 IP 查询

func GetIPLocation

func GetIPLocation(ip string) (*IPResponse, error)

GetIPLocation 查询 IP 的位置信息

Jump to

Keyboard shortcuts

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