Merge branch 'backendhack' into 'develop'
[akkoma] / lib / pleroma / uploaders / uploader.ex
1 defmodule Pleroma.Uploaders.Uploader do
2 @moduledoc """
3 Defines the contract to put an uploaded file to any backend.
4 """
5
6 @doc """
7 Put a file to the backend.
8
9 Returns `{:ok, String.t } | {:error, String.t} containing the path of the
10 uploaded file, or error information if the file failed to be saved to the
11 respective backend.
12 """
13 @callback put_file(
14 name :: String.t(),
15 uuid :: String.t(),
16 file :: File.t(),
17 content_type :: String.t(),
18 should_dedupe :: Boolean.t()
19 ) :: {:ok, String.t()} | {:error, String.t()}
20 end