maxmind

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadASNDB

func DownloadASNDB() error

func DownloadAllDB

func DownloadAllDB()

func DownloadCityDB

func DownloadCityDB() error

func DownloadCountryDB

func DownloadCountryDB() error

func GetDB added in v0.7.0

func GetDB(dbType string) *geoip2.Reader

func GetDBFilePath

func GetDBFilePath(dbType string) string

func LoadAllDB added in v0.7.0

func LoadAllDB() error

func RunDBDownloadJob

func RunDBDownloadJob()

Types

type GeoIP

type GeoIP struct {
	IPCity
	IPASN
	IP     string `json:"ip"`
	Remark string `json:"remark,omitempty"`
}

func IP2Geo

func IP2Geo(ip string) (GeoIP, error)

type IPASN

type IPASN struct {
	IP           string `json:"ip"`
	ASN          uint   `json:"asn"`
	Organization string `json:"organization"`
}

func IP2ASN

func IP2ASN(ip string) (IPASN, error)

type IPCity

type IPCity struct {
	IP   string `json:"ip"`
	City string `json:"city"`
	IPCountry
	Timezone  string  `json:"timezone"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

func IP2City

func IP2City(ip string) (IPCity, error)

type IPCountry

type IPCountry struct {
	IP                  string `json:"ip"`
	Country             string `json:"country"`
	Continent           string `json:"continent"`
	ISOCountryCode      string `json:"iso_country_code"`
	ISOContinentCode    string `json:"iso_continent_code"`
	IsAnonymousProxy    bool   `json:"is_anonymous_proxy"`
	IsSatelliteProvider bool   `json:"is_satellite_provider"`
}

func IP2Country

func IP2Country(ip string) (IPCountry, error)

Jump to

Keyboard shortcuts

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