Bardo.Tarball (Bardo v0.1.0)

View Source

Functions for creating and extracting tarballs.

This module provides functionality for packing and unpacking tarball archives.

Summary

Functions

Creates a tarball with the specified metadata and files.

Unpacks a tarball and returns its contents.

Functions

create(metadata, files)

@spec create(map(), list()) :: {:ok, {binary(), binary()}} | {:error, term()}

Creates a tarball with the specified metadata and files.

unpack(tarball, location)

@spec unpack(binary(), :memory | String.t()) ::
  {:ok, %{checksum: binary(), metadata: map(), contents: list()}}
  | {:error, term()}

Unpacks a tarball and returns its contents.

The location parameter determines where to unpack the files. When :memory is specified, no files are created but the contents are returned in-memory.