iputil

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientIp

func GetClientIp(httpReq *http.Request) (string, error)

GetClientIp returns the client IP address from the http.Request

func GetCountryAndCity

func GetCountryAndCity(ip string) (country, city string, err error)

GetCountryAndCity returns the city and continent of an IP address.

Types

type IPInfo

type IPInfo struct {
	Query     string `json:"query"`     //待查询的IP
	Status    string `json:"status"`    //查询状态,如success
	Continent string `json:"continent"` //大洲	//Mobile  bool `json:"mobile"`
	Country   string `json:"country"`
	City      string `json:"city"`
}

IPInfo contains information about an IP address.

func GetIPInfo

func GetIPInfo(ip string) (*IPInfo, error)

GetIPInfo returns information about an IP address.

Jump to

Keyboard shortcuts

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