shortnr/lib/url/repo/repo.ex

16 lines
503 B
Elixir
Raw Normal View History

2019-12-08 18:44:04 +00:00
defmodule Shortnr.URL.Repo do
@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
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()
@callback delete(String.t()) :: :ok | Transport.error()
2019-12-08 18:44:04 +00:00
@callback list() :: {:ok, list(URL.t())} | Transport.error()
@callback reset() :: :ok | Transport.error()
2019-12-08 18:44:04 +00:00
end