View Source Geocoder.Provider behaviour (geocoder v2.0.1)

Specifies expected behaviour for a provider

Summary

Types

@type option() ::
  {:json_codec, atom()}
  | {:http_client, atom()}
  | {:http_client_opts, term()}
  | {:key, binary()}
  | {:data, term()}
@type options() :: [option()]
@type payload() :: keyword()

Callbacks

Link to this callback

geocode(payload, options)

View Source
@callback geocode(payload(), options()) :: {:ok, Geocoder.Coords.t()} | {:error, any()}
Link to this callback

geocode_list(payload, options)

View Source
@callback geocode_list(payload(), options()) ::
  {:ok, Geocoder.Coords.t()} | {:error, any()}
Link to this callback

reverse_geocode(payload, options)

View Source
@callback reverse_geocode(payload(), options()) ::
  {:ok, Geocoder.Coords.t()} | {:error, any()}
Link to this callback

reverse_geocode_list(payload, options)

View Source
@callback reverse_geocode_list(payload(), options()) ::
  {:ok, Geocoder.Coords.t()} | {:error, any()}