Packages

An Elixir library for the IP2Location database.

Current section

Files

Jump to
ip2location lib ip2location server.ex
Raw

lib/ip2location/server.ex

defmodule IP2Location.Server do
use GenServer
@behaviour :poolboy_worker
def start_link(default \\ %{}) do
GenServer.start_link(__MODULE__, default)
end
def handle_call({ :lookup, ip }, _, state) do
{ :reply, IP2Location.Database.lookup(ip), state }
end
end