Lei.Cache.Importer (LowEndInsight v0.9.1)

Copy Markdown View Source

Imports LEI cache snapshots from local directories or OCI artifacts.

Supports two import modes:

  • Local directory import (from a previously exported or pulled cache)
  • OCI pull + import (pulls from registry, then imports)

Summary

Functions

Imports a cache snapshot from a local directory.

Pulls a cache artifact from an OCI registry and saves to target_dir.

Functions

import_local(dir)

@spec import_local(String.t()) :: {:ok, map(), [map()]} | {:error, String.t()}

Imports a cache snapshot from a local directory.

Reads manifest.json and cache.jsonl.gz from the given directory. Returns {:ok, manifest, reports} where manifest is the cache metadata and reports is a list of decoded analysis report maps.

pull(oci_ref, target_dir, opts \\ [])

@spec pull(String.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, String.t()}

Pulls a cache artifact from an OCI registry and saves to target_dir.

Parses the OCI reference, pulls the manifest and blobs, and writes cache files to the target directory.

Returns {:ok, target_dir} or {:error, reason}.