Documentation
¶
Index ¶
- func Extract(archivePath, dest string) ([]byte, error)
- func Pack(srcDir string, sidecar []byte, outPath string, c Compression) error
- func ReadSidecar(archivePath string) ([]byte, error)
- func ReadSidecarAndManifestBlobs(archivePath string, digests []digest.Digest) ([]byte, map[digest.Digest][]byte, error)
- type Compression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
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 ¶
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" )