Geolix.Adapter behaviour (Geolix v2.0.0) View Source
Adapter behaviour module.
Link to this section Summary
Callbacks
Returns the adapter processes to be supervised.
Loads a given database into Geolix.
Looks up IP information.
Returns metadata information for a database if available.
Unloads a given database from Geolix.
Link to this section Callbacks
Specs
database_workers(database :: Geolix.database()) :: [ :supervisor.child_spec() | {module(), term()} | module() ]
Returns the adapter processes to be supervised.
If no automatic supervision should take place or it is intended to use an adapter specific supervisor (e.g. using the application config) this callback should be either unimplemented or return an empty list.
Specs
load_database(database :: Geolix.database()) :: :ok | :delayed | {:error, term()}
Loads a given database into Geolix.
Requires at least the fields :id
and :adapter
. Any other required
fields depend on the adapter's requirements.
Specs
lookup( ip :: :inet.ip_address(), opts :: Keyword.t(), database :: Geolix.database() ) :: map() | nil
Looks up IP information.
Specs
metadata(database :: Geolix.database()) :: map() | nil
Returns metadata information for a database if available.
Specs
unload_database(database :: Geolix.database()) :: :ok
Unloads a given database from Geolix.