Regc.Blob.Reader (regc v0.0.2)
View SourceIncrementally verified blob content.
Digest and size verification completes when read/2 returns :eof.
Enumeration closes the underlying transport on completion or early halt.
Summary
Functions
Returns a specification to start this module under a supervisor.
Closes the blob and its underlying transport reader.
Reads up to max_bytes. Verification errors are returned as structured
Regc.Error values.
Returns a lazy stream of verified blob chunks.
Types
@type read_result() :: {:ok, binary()} | :eof | {:error, Regc.Error.t()}
@type t() :: %Regc.Blob.Reader{metadata: Regc.Blob.Metadata.t(), pid: pid()}
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec close(t()) :: :ok
Closes the blob and its underlying transport reader.
@spec read(t(), pos_integer()) :: read_result()
Reads up to max_bytes. Verification errors are returned as structured
Regc.Error values.
@spec stream(t(), pos_integer()) :: Enumerable.t()
Returns a lazy stream of verified blob chunks.