Packmatic v0.1.0 Packmatic View Source

Top-level module holding the Packmatic library, which provides ZIP-oriented stream aggregation services from various sources.

Link to this section Summary

Functions

Builds a Stream which can be consumed to construct a ZIP file from various sources, as specified in the Manifest. When buinding the Stream, options can be passed to configure how the Encoder should behave when Source acquisition fails.

Link to this section Types

Link to this type

source_option()

View Source
source_option() :: {:timestamp, DateTime.t()}
Link to this type

source_path()

View Source
source_path() :: Path.t()
Link to this type

stream_entry()

View Source
stream_entry() :: {source_entry(), source_path()}
Link to this type

stream_entry_extended()

View Source
stream_entry_extended() ::
  {source_entry(), source_path(), [source_option(), ...]}

Link to this section Functions

Link to this function

build_stream(target, options \\ [])

View Source
build_stream(manifest(), options()) :: term()
build_stream([stream_entry() | stream_entry_extended(), ...], options()) ::
  term()

Builds a Stream which can be consumed to construct a ZIP file from various sources, as specified in the Manifest. When buinding the Stream, options can be passed to configure how the Encoder should behave when Source acquisition fails.

Examples

stream = Packmatic.build_stream([
  {{:file, "/tmp/hello.pdf"}, "hello.pdf"},
  {{:file, "/tmp/world.pdf"}, "world.pdf"}
])

stream = Packmatic.build_stream([
  {{:file, "/tmp/htllo.pdf"}, "hello.pdf"},
  {{:file, "/tmp/world.pdf"}, "world.pdf"}
], on_error: :skip)