magda-em / freegeoip-java-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#freegeoip java client Build Status JCenter License

###Usage ####Ratelimited Client

final int maxRequestsPerSecond = 1;
final FreeGeoIP freegeoip = new FreeGeoIPClient(maxRequestsPerSecond);

final GeoIP myGeoIp = freegeoip.getGeoIP();
final Coordinate myCoordinates = myGeoIp.getCoordinates();
...

####Netflix Ribbon Load Balanced Client

final String hostPorts = "host1:port1,host2:port2,host3:port3";
final LoadBalancedFreeGeoIPClient freegeoip = LoadBalancedFreeGeoIPClient.createDefault(hostPorts);

final GeoIP myGeoIp = freegeoip.getGeoIP();
final Coordinate myCoordinates = myGeoIp.getCoordinates();

System.out.println(freegeoip.getLoadBalancer().getLoadBalancerStats());
...

###Dependency Management ####Gradle

repositories {
   jcenter()
}

dependencies {
   compile 'com.fabahaba:freegeoip-java-client:0.1.2'
}

About

License:Apache License 2.0


Languages

Language:Java 100.0%