Uploadex v2.0.2 Uploadex.Storage behaviour View Source

Behaviour for a Storage implementation.

Link to this section Summary

Callbacks

Deletes the file

Returns the path of a temporary file, that will be deleted after the configured amount of time.

Returns the file's URL

Stores the file

Link to this section Types

Link to this section Callbacks

Link to this callback

delete(file, opts)

View Source
delete(file(), opts()) :: :ok | {:error, any()}

Deletes the file

Link to this callback

get_temporary_file(file, arg2, opts)

View Source
get_temporary_file(file(), String.t(), opts()) :: String.t()

Returns the path of a temporary file, that will be deleted after the configured amount of time.

Link to this callback

get_url(file, opts)

View Source
get_url(file(), opts()) :: {status(), String.t()}

Returns the file's URL

Link to this callback

store(file, opts)

View Source
store(file(), opts()) :: :ok | {:error, any()}

Stores the file