View Source Entrepot.Upload protocol (Bonfire v0.9.10-classic-beta.169)
A protocol defining the interface for file uploads.
This protocol should be implemented by any struct that represents an uploadable file.
There are built-in implementations for Plug.Upload
, File.Stream,
Stream,
URIand
Entrepot.Locator`.
Summary
Functions
Retrieves the contents of the upload.
Retrieves the name of the upload.
Retrieves the path of the upload, if available.
Types
@type t() :: term()
All the types that implement this protocol.
Functions
Retrieves the contents of the upload.
Returns
{:ok, iodata()}
: The contents of the upload.{:error, String.t()}
: An error message if the contents cannot be retrieved.
Retrieves the name of the upload.
Returns
String.t()
: The name of the upload.
Retrieves the path of the upload, if available.
Returns
String.t()
: The path of the upload.nil
: If no path is available.