Expand description
Package- and diff-archive tarball helpers.
Both package archives (.socket/packages/<uuid>.tar.gz) and diff
archives (.socket/diffs/<uuid>.tar.gz) use the same on-disk format:
a gzipped tar containing one entry per patched file. The entry’s path
matches the normalized relative file path (i.e. without the
package/ prefix used by the API).
For package archives, each entry holds the patched file’s full bytes.
For diff archives, each entry holds a bsdiff delta that transforms the
corresponding beforeHash content into the afterHash content.
Enums§
- Archive
Error - Errors produced while reading a package/diff archive.
Functions§
- read_
archive_ filtered - Subset of
read_archive_to_mapthat only keeps entries whose normalized path appears inexpected_files. Anything else in the archive is silently dropped — this is defense-in-depth so a malicious archive cannot drop arbitrary files into the package directory. - read_
archive_ to_ map - Read a
.tar.gzarchive into a map ofnormalized_path -> bytes.