2019-12-08 18:44:04 +00:00
|
|
|
defmodule Shortnr.URL.Repo do
|
2019-12-31 02:50:39 +00:00
|
|
|
@moduledoc """
|
|
|
|
This module defines the Repo behaviour for the URL service. All Repos must implement this
|
|
|
|
entire behaviour.
|
|
|
|
"""
|
|
|
|
|
2019-12-08 18:44:04 +00:00
|
|
|
alias Shortnr.Transport
|
2019-12-31 02:50:39 +00:00
|
|
|
alias Shortnr.URL
|
2019-12-08 18:44:04 +00:00
|
|
|
|
|
|
|
@callback put(URL.t()) :: :ok | Transport.error()
|
|
|
|
@callback get(String.t()) :: {:ok, URL.t()} | Transport.error()
|
2019-12-09 02:39:11 +00:00
|
|
|
@callback delete(String.t()) :: :ok | Transport.error()
|
2019-12-08 18:44:04 +00:00
|
|
|
@callback list() :: {:ok, list(URL.t())} | Transport.error()
|
2019-12-26 21:11:43 +00:00
|
|
|
@callback reset() :: :ok | Transport.error()
|
2019-12-08 18:44:04 +00:00
|
|
|
end
|