FileStream.Storage behaviour (file_stream v0.7.0)
A behaviour for streaming files from storage.
Link to this section Summary
Callbacks
A callback to initialize a stream with the provided options.
A callback for Collectable.into/1
.
A callback for Enumerable.reduce/3
.
Functions
Determines the FileStream.Storage
implementation based on a URI scheme.
Similar to from_uri/1
but raises a FileStream.Error
if storage is not supported.
Link to this section Types
@type t() :: module()
Link to this section Callbacks
Link to this callback
init(keyword)
A callback to initialize a stream with the provided options.
Link to this callback
into(t)
@callback into(FileStream.t()) :: {FileStream.t(), (FileStream.t(), Collectable.command() -> FileStream.t())}
A callback for Collectable.into/1
.
Link to this callback
reduce(t, acc, reducer)
@callback reduce(FileStream.t(), Enumerable.acc(), Enumerable.reducer()) :: Enumerable.result()
A callback for Enumerable.reduce/3
.
Link to this section Functions
Link to this function
from_uri(uri)
Determines the FileStream.Storage
implementation based on a URI scheme.
Returns {:ok, storage}
on success or :error
if storage is not supported.
Link to this function
from_uri!(uri)
Similar to from_uri/1
but raises a FileStream.Error
if storage is not supported.