View Source LastfmArchive.Cache behaviour (lastfm_archive v0.10.0)

GenServer storing archiving state to ensure scrobbles are fetched only once.

Link to this section Summary

Link to this section Types

@type end_of_day() :: integer()
@type start_of_day() :: integer()
@type user() :: binary()
@type year() :: integer()

Link to this section Callbacks

@callback get(
  {user(), year()},
  GenServer.server()
) :: map()
Link to this callback

load(user, server, keyword)

View Source
@callback load(user(), GenServer.server(), keyword()) :: map()
Link to this callback

put({}, {}, tuple, server)

View Source
@callback put(
  {user(), year()},
  {start_of_day(), end_of_day()},
  tuple(),
  GenServer.server()
) :: :ok
Link to this callback

serialise(user, server, keyword)

View Source
@callback serialise(user(), GenServer.server(), keyword()) :: term()

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

clear(user, server \\ __MODULE__, options)

View Source
@spec clear(binary(), GenServer.server(), keyword()) :: map()
Link to this function

get(key, server \\ __MODULE__)

View Source
Link to this function

load(user, server \\ __MODULE__, options \\ [])

View Source
Link to this function

put(arg1, arg2, value, server \\ __MODULE__)

View Source
Link to this function

reset(server \\ __MODULE__, options \\ [])

View Source
@spec reset(
  GenServer.server(),
  keyword()
) :: :ok
Link to this function

serialise(user, server \\ __MODULE__, options \\ [])

View Source
@spec state() :: map()
@spec state(GenServer.server()) :: map()