Geolix v0.15.1 Geolix.Adapter.Fake View Source

Fake adapter for testing environments.

Link to this section Summary

Functions

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

Implementation of Geolix.Adapter.load_database/1

Looks up IP information

Link to this section Functions

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.

Callback implementation for Geolix.Adapter.database_workers/0.

Implementation of Geolix.Adapter.load_database/1.

Requires the parameter :data to be a map with all database entries.

Each database entry is one entry in the map. The key should be an exact IP address in a format returned by :inet.parse_address/1 while the result can be any term.

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.

Callback implementation for Geolix.Adapter.lookup/2.