View Source SRTM.Cache behaviour (SRTM v0.8.0)

Specifies the API for using a custom Cache.

The default caches are SRTM.Cache.PersistentTerm and SRTM.Cache.File.

Summary

Callbacks

For the given identifier, fetches a data cell from the cache.

Stores the given data cell in the cache.

Callbacks

@callback fetch(identifier :: Path.t()) :: {:ok, SRTM.DataCell.t()} | :error

For the given identifier, fetches a data cell from the cache.

Link to this callback

store(identifier, data_cell)

View Source
@callback store(identifier :: Path.t(), data_cell :: SRTM.DataCell.t()) ::
  :ok | {:error, SRTM.Error.t()}

Stores the given data cell in the cache.