storage v0.2.0 Storage.Adapter behaviour View Source

Behaviour used as a guide to implement adapters.

TODO: How to implement an adapter

Link to this section Summary

Callbacks

Deletes the file in given path

Generates path from list of scope and filename

Stores the file using the Storage.File struct and source path of the file

Returns URL of the file from given path

Link to this section Types

Link to this section Callbacks

Link to this callback delete(path) View Source
delete(path()) :: :ok | {:error, String.t()}

Deletes the file in given path.

Generates path from list of scope and filename.

Used only if adapter needs to append part of path to file destination path, where it will be stored.

Link to this callback put(file, path) View Source
put(file(), path()) :: file()

Stores the file using the Storage.File struct and source path of the file.

Returns URL of the file from given path.