aboutsummaryrefslogtreecommitdiff
path: root/apps/dreki/src/store/dreki_store_backend.erl
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dreki/src/store/dreki_store_backend.erl')
-rw-r--r--apps/dreki/src/store/dreki_store_backend.erl33
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/dreki/src/store/dreki_store_backend.erl b/apps/dreki/src/store/dreki_store_backend.erl
new file mode 100644
index 0000000..55db90e
--- /dev/null
+++ b/apps/dreki/src/store/dreki_store_backend.erl
@@ -0,0 +1,33 @@
+-module(dreki_store_backend).
+-include("dreki.hrl").
+
+-type t() :: module().
+
+-type backend_ref() :: any().
+-type backend_checkout_ref() :: any().
+
+-type args() :: any().
+
+-callback valid_store(dreki_expanded_uri(), Namespace_mod :: module(), Args :: any()) -> ok | {error, any()}.
+
+-callback start() -> ok | {error, ba}.
+
+-callback start(binary(), binary(), dreki_urn:urn(), args()) -> {ok, backend_ref()} | {error, any()}.
+
+-callback stop() -> ok.
+
+-callback stop(backend_ref()) -> ok.
+
+-callback checkout(backend_ref()) -> {ok, backend_checkout_ref()} | {error, any()}.
+
+-callback checkin(backend_checkout_ref()) -> ok.
+
+-callback list(backend_checkout_ref()) -> {ok, dreki_store_namespace:collection()}.
+
+-callback get(backend_checkout_ref(), dreki_id()) -> {ok, dreki_store_namespace:item()} | not_found | {error, any()}.
+
+-callback create(backend_checkout_ref(), dreki_store_namespace:item()) -> ok | {error, any()}.
+
+-callback update(backend_checkout_ref(), dreki_store_namespace:item()) -> ok | not_found | {error, any()}.
+
+-callback delete(backend_checkout_ref(), dreki_id()) -> ok | not_found | {error, any()}.