Behaviour for storing and retrieving export files and other persistent artifacts.
Threadline provides a Threadline.Storage.Local implementation out-of-the-box
for single-node deployments. Adopters needing multi-node support should implement
an S3-compatible backend conforming to this behaviour.
The init/1 callback is used for dependency safeguards, ensuring adapters fail
early if their required underlying library is missing from the environment.
Summary
Callbacks
Deletes a file from storage.
Generates a presigned or localized URL for downloading the file.
Retrieves a file's content from storage.
Initializes the adapter. Called during application startup to verify configuration and presence of underlying dependencies.
Returns a direct local path to the stored file, if supported by the backend.
Puts a file into storage.
Types
Callbacks
Deletes a file from storage.
Generates a presigned or localized URL for downloading the file.
Options may include :expires_in (in seconds).
Retrieves a file's content from storage.
Initializes the adapter. Called during application startup to verify configuration and presence of underlying dependencies.
Returns a direct local path to the stored file, if supported by the backend.
@callback put(path_or_content(), options()) :: {:ok, file_id()} | {:error, term()}
Puts a file into storage.
Returns {:ok, file_id} where file_id is a backend-specific identifier
(such as an S3 key or a local filesystem path) that can be used with get/1
and download_url/2.