Geolix v0.15.1 Geolix.Adapter behaviour View Source

Adapter behaviour module.

Link to this section Summary

Callbacks

Returns the children to be supervised by Geolix.Database.Supervisor

Loads a given database into Geolix

Looks up IP information

Link to this section Callbacks

Link to this callback database_workers() View Source (optional)
database_workers() :: list()

Returns the children to be supervised by Geolix.Database.Supervisor.

If no automatic supervision should take place or it is intended to use a adapter specific supervisor (e.g. using the application config) this callback should be either unimplemented or return an empty list.

Link to this callback load_database(map) View Source (optional)
load_database(map()) :: :ok

Loads a given database into Geolix.

Requires at least the fields :id and :adapter. Any other required fields depend on the adapter’s requirements.

Link to this callback lookup(ip, opts) View Source
lookup(ip :: tuple(), opts :: Keyword.t()) :: map() | nil

Looks up IP information.

The passed opts are expected to contain a key :where to define which database should be queried. If that key is not set then nil should be returned instead.