Skip to content
/ geo Public

Looks up geoinfo from MaxMind GeoLite2 Database fetched from web

License

Notifications You must be signed in to change notification settings

getlantern/geo

Repository files navigation

Go Actions Status

geo

Looks up geoinfo from MaxMind GeoLite2 Database fetched from web. Currently only country code is supported but later can be extend to city, ISP, etc.

Example:

  // Keep in sync with the database from geolite2_url every day, without
  // keeping a local copy in disk.
  lookup = geo.New(geolite2_url, 24*time.Hour, "")
  // or local copy so it's available immediately when the service restarts.
  lookup = geo.New(geolite2_url, 24*time.Hour, "local-file-path")
  country = lookup.CountryCode(net.ParseIP("1.1.1.1"))

About

Looks up geoinfo from MaxMind GeoLite2 Database fetched from web

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages