7380320af41cd2f5b4e71f1feb140a61a1abe714
[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 a `String.t` containing the path of the uploaded file.
10 """
11 @callback put_file(
12 name :: String.t(),
13 uuid :: String.t(),
14 file :: File.t(),
15 content_type :: String.t(),
16 should_dedupe :: Boolean.t()
17 ) :: String.t()
18
19 @callback put_file(
20 name :: String.t(),
21 uuid :: String.t(),
22 image_data :: String.t(),
23 content_type :: String.t(),
24 should_dedupe :: String.t()
25 ) :: String.t()
26 end