geodata

package
v0.0.0-...-420b085 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoData

type GeoData struct {
	Country struct {
		IsoCode string            `maxminddb:"iso_code"`
		Names   map[string]string `maxminddb:"names"`
	} `maxminddb:"country"`
	City struct {
		Names map[string]string `maxminddb:"names"`
	} `maxminddb:"city"`
	Location struct {
		AccuracyRadius uint16  `maxminddb:"accuracy_radius"`
		Latitude       float64 `maxminddb:"latitude"`
		Longitude      float64 `maxminddb:"longitude"`
		MetroCode      uint    `maxminddb:"metro_code"`
		TimeZone       string  `maxminddb:"time_zone"`
	} `maxminddb:"location"`
}

type GeoIP2DB

type GeoIP2DB struct {
	// contains filtered or unexported fields
}

func NewGeoIP2DB

func NewGeoIP2DB(databaseFilePath string) (*GeoIP2DB, error)

func (*GeoIP2DB) Close

func (g *GeoIP2DB) Close() error

func (*GeoIP2DB) GetGeoDataFromIPAddress

func (g *GeoIP2DB) GetGeoDataFromIPAddress(ipAddress string) (*GeoData, error)

Jump to

Keyboard shortcuts

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