FileStream (file_stream v0.7.0)

A module to stream file-like resources.

Link to this section Summary

Functions

Gets the value for a specific key within the stream meta.

Puts the given value under key of the stream meta.

Resets the stream meta to be empty.

Returns a FileStream for the given resource.

Link to this section Types

@type t() :: %FileStream{
  config: any(),
  meta: map(),
  storage: FileStream.Storage.t(),
  uri: URI.t()
}

Link to this section Functions

Link to this function

get_meta(stream, key)

@spec get_meta(t(), atom()) :: any()

Gets the value for a specific key within the stream meta.

Link to this function

put_meta(stream, key, value)

@spec put_meta(t(), atom(), any()) :: t()

Puts the given value under key of the stream meta.

Link to this function

reset_meta(stream)

@spec reset_meta(t()) :: t()

Resets the stream meta to be empty.

Link to this function

stream!(resource, opts \\ [])

@spec stream!(
  FileStream.Resource.t(),
  keyword()
) :: t()

Returns a FileStream for the given resource.

The resource must be any term that implements the FileStream.Resource protocol.

By default, implementations for String and URI are included.