Description:
GeoIP information aggregator service with local cache. Demo.
Application launch:
In order to run the application install >=MongoDB 3.0.14. and package manager:
go get github.com/constabulary/gb/...
Restore dependencies from manifest:
gb vendor restore
To build the application run the following command:
gb build
To launch unit tests run the command:
gb test
To launch application:
bin/main
Configuration:
In order to get the default configuration file launch the application to generate it. Configuration file:
{ "tcp_server": { "address": "0.0.0.0:9999" }, "geo_ip_provider": { "providers": [ "freegeoip.net", "geoip.nekudo.com" ], "requests_limit": 100, "time_interval_min": 1 }, "cache": { "address": "localhost", "db_name": "resolver", "username": "", "password": "", "collection": "cache", "items_limit": 100000 } }
Application check:
To check the work of the application one can use Netcat or Telnet, for example:
nc 0.0.0.0 9999
The service must return the information about the country based on the user's IP address.