README
¶
geo-cli
Geo cli tool written in Golang using MaxMind geo data
Installation
$ go install github.com/major1201/geo-cli/cmd/geo
Usage
Download a MaxMind geo data file in https://dev.maxmind.com/geoip/geoip2/geolite2/
Set the environment var
export GEO_MMDBFILE=/opt/GeoLite2-City.mmdb
Query one address in detail
geo --detail 81.2.69.142
Query multiple addresses in one-line format
geo www.google.com 81.2.69.142
Read from pipe
traceroute www.google.com | geo
Specify language
geo --language zh-CN 81.2.69.142
Contributing
Just fork the repositry and open a pull request with your changes.
Licence
MIT
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Geo ¶
type Geo struct { ContinentCode string `` /* 189-byte string literal not displayed */ ContinentName string `` /* 188-byte string literal not displayed */ CountryIsoCode string `` /* 196-byte string literal not displayed */ CountryName string `` /* 147-byte string literal not displayed */ SubdivisionIsoCode string `` /* 214-byte string literal not displayed */ SubdivisionName string `` /* 182-byte string literal not displayed */ CityName string `` /* 163-byte string literal not displayed */ PostalCode string `` /* 168-byte string literal not displayed */ Latitude float64 `de:"Breite" en:"Latitude" es:"Latitud" fr:"Latitude" ja:"緯度" pt-BR:"Latitude" ru:"широта" zh-CN:"纬度"` Longitude float64 `de:"Länge" en:"Longitude" es:"Longitud" fr:"Longitude" ja:"経度" pt-BR:"Longitude" ru:"долгота" zh-CN:"经度"` TimeZone string `` /* 151-byte string literal not displayed */ }
Geo is the parsed record geo data
Click to show internal directories.
Click to hide internal directories.