Name: go-geoip-service
Owner: Kik Interactive
Description: A Go (golang) HTTP service which will tell you the country associated with a given IP.
Forked from: dseevr/go-geoip-service
Created: 2017-06-18 12:24:43.0
Updated: 2017-06-18 12:24:45.0
Pushed: 2017-07-09 20:16:06.0
Size: 604
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Go (golang) HTTP service which will tell you the country associated with a given IP.
Go get:
et github.com/dseevr/go-geoip-service
ATH/bin/go-geoip-service --db-path=/mm.db --port=1234
Build it yourself:
clone git@github.com:dseevr/go-geoip-service.git
o-geoip-service
-geoip-service --db-path=/mm.db --port=1234
Run from Docker:
er run --rm -it \
1234:1234 \
/foo/bar/GeoLite2-Country.mmdb:/mm.db:ro \
llrobinson/go-geoip-service --db-path=/mm.db --port=1234
-s 'http://localhost:12345/lookup?ip=109.111.96.0'
Response:
ountry_code": "AD",
ountry": "Andorra",
egion_code": "07",
ity": "Andorra la Vella",
ontinent_code": "EU",
ontinent": "Europe",
ocation": {
"lat": 42.5,
"lon": 1.5167000000000002
You will need a GeoLite2 database from MaxMind. Specify it with the --db-path
option.
You can get a database here: https://dev.maxmind.com/geoip/geoip2/geolite2/
You will need to have a MaxMind database in the base folder called test.db
.
Then just run make test
!
BSD