Hrx.Archive (hrx v0.2.0)

Copy Markdown View Source

HRX file archive

Contains the contents in memory of an HRX file.

Summary

Types

t()

@type t() :: %Hrx.Archive{entries: %{required(String.t()) => Hrx.Entry.t()}}

Functions

exists?(archive, path)

read(archive, filename)

@spec read(t(), String.t()) :: {:ok, String.t()} | {:error, :enoent}

Read a file from the archive

{:ok, contents} = Hrx.Archive.read(archive, "dir/my-file.txt")
{:error, :enoent} = Hrx.Archive.read(archive, "non-existant-file.txt")