geoIPUtils

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseGeoIP

func CloseGeoIP(geoipDB *GeoipDB)

func GetIPASN

func GetIPASN(ip string, giAsnDb *geoip2.Reader) (asn string)

Finds and returns the ASN of the given ip

func GetIPCountry

func GetIPCountry(ip string, giCountryDb *geoip2.Reader) (country string)

Finds and returns the conuntry of the given ip

Types

type GeoipDB

type GeoipDB struct {
	CountryDb *geoip2.Reader
	AsnDb     *geoip2.Reader
}

func InitGeoIP

func InitGeoIP(geoipPath string, geoipCountryDbName string, geoipAsnDbName string, geoipLicenseKey string) *GeoipDB

Initialize GEO IP databases

Jump to

Keyboard shortcuts

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