Last active
October 10, 2016 12:26
-
-
Save radzserg/e723ab33aa9780a0ffade491ac321142 to your computer and use it in GitHub Desktop.
Upload Manager Interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule App.UploadManager.Behavior do | |
@doc """ | |
Check if file exists | |
""" | |
@callback exists?(String.t) :: :ok | {:error, String.t} | |
@doc """ | |
Save file to storage | |
""" | |
@callback save_from_file!(String.t, String.t, Map) :: :ok | {:error, String.t} | |
@doc """ | |
Save content to storage | |
""" | |
@callback save_from_content!(String.t, String.t, Map) :: :ok | {:error, String.t} | |
@doc """ | |
Delete file | |
""" | |
@callback delete!(String.t) :: :ok | {:error, String.t} | |
@doc """ | |
Return URL to file | |
""" | |
@callback url(String.t) :: String.t | |
@doc """ | |
Saves already existed in storage file to local file | |
""" | |
@callback save_to_local_file!(String.t, String.t) :: :ok | {:error, String.t} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment