Packmatic v0.1.0 Packmatic.Source behaviour View Source
Defines how data can be acquired in a piecemeal fashion, perhaps by reading only a few pages from the disk at a time or only a few MBs of data from an open socket.
Link to this section Summary
Functions
Transforms an Entry into a Source ready for acquisition. Called by Packmatic.Encoder
.
Consumes bytes off an initialised Source. Called by Packmatic.Encoder
.
Callbacks
Converts the Entry to a Source, or return failure.
Iterates the Source and return data as an IO List, :eof
, or failure.
Link to this section Types
Link to this type
entry()
View Sourceentry() :: entry_file() | entry_url() | entry_random() | entry_dynamic()
Link to this section Functions
Link to this function
build(arg)
View Sourcebuild(entry_file()) :: {:ok, Packmatic.Source.File.t()} | {:error, term()}
build(entry_url()) :: {:ok, Packmatic.Source.URL.t()} | {:error, term()}
build(entry_random()) :: {:ok, Packmatic.Source.Random.t()} | {:error, term()}
build(entry_dynamic()) :: {:ok, Packmatic.Source.Dynamic.t()} | {:error, term()}
Transforms an Entry into a Source ready for acquisition. Called by Packmatic.Encoder
.
Consumes bytes off an initialised Source. Called by Packmatic.Encoder
.
Link to this section Callbacks
Converts the Entry to a Source, or return failure.
Iterates the Source and return data as an IO List, :eof
, or failure.