aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/uploaders/uploader.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/uploaders/uploader.ex')
-rw-r--r--lib/pleroma/uploaders/uploader.ex20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/pleroma/uploaders/uploader.ex b/lib/pleroma/uploaders/uploader.ex
new file mode 100644
index 000000000..b58fc6d71
--- /dev/null
+++ b/lib/pleroma/uploaders/uploader.ex
@@ -0,0 +1,20 @@
+defmodule Pleroma.Uploaders.Uploader do
+ @moduledoc """
+ Defines the contract to put an uploaded file to any backend.
+ """
+
+ @doc """
+ Put a file to the backend.
+
+ Returns `{:ok, String.t } | {:error, String.t} containing the path of the
+ uploaded file, or error information if the file failed to be saved to the
+ respective backend.
+ """
+ @callback put_file(
+ name :: String.t(),
+ uuid :: String.t(),
+ file :: File.t(),
+ content_type :: String.t(),
+ should_dedupe :: Boolean.t()
+ ) :: {:ok, String.t()} | {:error, String.t()}
+end