summaryrefslogtreecommitdiff
path: root/lib/pleroma/uploaders/uploader.ex
blob: 7380320af41cd2f5b4e71f1feb140a61a1abe714 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 a `String.t` containing the path of the uploaded file.
  """
  @callback put_file(
              name :: String.t(),
              uuid :: String.t(),
              file :: File.t(),
              content_type :: String.t(),
              should_dedupe :: Boolean.t()
            ) :: String.t()

  @callback put_file(
              name :: String.t(),
              uuid :: String.t(),
              image_data :: String.t(),
              content_type :: String.t(),
              should_dedupe :: String.t()
            ) :: String.t()
end