项目作者: danielcherubini

项目描述 :
A small API that runs locally for Maxmind DB
高级语言: Go
项目地址: git://github.com/danielcherubini/geoip-api.git
创建时间: 2017-05-26T11:28:28Z
项目社区:https://github.com/danielcherubini/geoip-api

开源协议:

下载


Build Status Coverage Status

geoip-api

I convert ip’s into countries and stuff

Usage

  1. ./geoip-api --lang languages.json

Lang is Required

Flags

  • lang —- location of local language.json
  • mmdb - location of local .mmdb file
  • gzdb — location of local .gzip file
  • dburl — location of remote file (can be mmdb or gzip)
  • s3bucket — s3 bucket
  • s3key — full filepath so if the file is at /foo/bar/qux.jpg then thats your key
  • s3region — region of the s3 bucket

Language JSON

  1. {
  2. "languages": [
  3. { "language": "en", "country": "US" },
  4. { "language": "en", "country": "CA" },
  5. { "language": "en", "country": "AU" },
  6. { "language": "en", "country": "GB" },
  7. { "language": "en", "country": "NO" },
  8. { "language": "es", "country": "MX" },
  9. { "language": "es", "country": "ES" }
  10. ],
  11. "default": {
  12. "language": "en",
  13. "country": "NO"
  14. }
  15. }

API Usage

  1. curl http://127.0.0.1:45000/\?ip\=193.215.2.26

Install using

  1. curl -Ls https://raw.githubusercontent.com/danielcherubini/geoip-api/master/install.sh | sudo -H sh