archive

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(archivePath, dest string) ([]byte, error)

Extract writes every entry of the delta archive into dest and returns the sidecar bytes. dest must already exist and be empty.

func Pack

func Pack(srcDir string, sidecar []byte, outPath string, c Compression) error

Pack writes a tar archive containing every file under srcDir plus the sidecar payload as "diffah.json" at the archive root.

Pack writes to outPath+".tmp" first and renames on success, guaranteeing that observers never see a partial file at outPath.

func ReadSidecar

func ReadSidecar(archivePath string) ([]byte, error)

ReadSidecar returns the sidecar bytes from a delta archive without extracting the rest of the entries.

func ReadSidecarAndManifestBlobs added in v0.2.0

func ReadSidecarAndManifestBlobs(
	archivePath string, digests []digest.Digest,
) ([]byte, map[digest.Digest][]byte, error)

ReadSidecarAndManifestBlobs returns the sidecar bytes and the bytes of every blob in digests, in a single tar pass. Used by `diffah inspect` to enrich per-image output without extracting the full archive. Every digest in the argument MUST appear as a `blobs/<algo>/<encoded>` entry; missing-blob is an error. The returned map is keyed by digest, never nil. A nil or empty digests slice is equivalent to ReadSidecar and yields an empty blob map.

Types

type Compression

type Compression string

Compression is the outer wrapper applied to the tar stream.

const (
	CompressNone Compression = "none"
	CompressZstd Compression = "zstd"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL