View Source Money.ExchangeRates.Cache behaviour (Money v5.9.0)
Defines a cache behaviour and default inplementation of a cache for exchange rates
Link to this section Summary
Callbacks
Returns the exchange rates for a given date.
Initialize the cache when the exchange rates retriever is started
Retrieve the latest exchange rates from the cache.
Store the historic exchange rates for a given date in the cache.
Store the latest exchange rates in the cache.
Terminate the cache when the retriver process stops normally
Link to this section Callbacks
Specs
historic_rates(Date.t()) :: {:ok, map()} | {:error, {Exception.t(), String.t()}}
Returns the exchange rates for a given date.
Specs
init() :: any()
Initialize the cache when the exchange rates retriever is started
Specs
latest_rates() :: {:ok, map()} | {:error, {Exception.t(), String.t()}}
Retrieve the latest exchange rates from the cache.
Specs
Store the historic exchange rates for a given date in the cache.
Specs
store_latest_rates(map(), DateTime.t()) :: :ok
Store the latest exchange rates in the cache.
Specs
terminate() :: any()
Terminate the cache when the retriver process stops normally