ipx

package
v0.4.2-gz9 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Browser        = "Unknown"
	BrowserVersion = "Unknown"
	Os             = "Unknown"
	Device         = "Unknown"
)

Variables

This section is empty.

Functions

func IsValidIPv4

func IsValidIPv4(ip string) bool

IsValidIPv4 checks if the provided string is a valid IPv4 address.

func ParseAgent

func ParseAgent(userAgent string) (browser string, browserVersion string, os string, device string)

ParseAgent Function to extract detailed information from User-Agent

Types

type IPInfo

type IPInfo struct {
	IP          string  `json:"ip"`
	CountryCode string  `json:"country_code"`
	CountryName string  `json:"country_name"`
	RegionName  string  `json:"region_name"`
	CityName    string  `json:"city_name"`
	Latitude    float64 `json:"latitude"`
	Longitude   float64 `json:"longitude"`
	ZipCode     string  `json:"zip_code"`
	TimeZone    string  `json:"time_zone"`
	Asn         string  `json:"asn"`
	As          string  `json:"as"`
	IsProxy     bool    `json:"is_proxy"`
}

func Query

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

func QueryFree

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

func QueryWithKey

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

Jump to

Keyboard shortcuts

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