Lei.Cache.Exporter (LowEndInsight v0.9.1)

Copy Markdown View Source

Exports LEI analysis reports as cache snapshot files.

Generates two files in an export directory:

  • manifest.json - Metadata about the cache snapshot
  • cache.jsonl.gz - Gzipped JSONL of analysis reports

These files can then be packaged as an OCI artifact via Lei.Cache.OCI.

Summary

Functions

Exports a list of analysis reports to the given directory.

Reads analysis reports from a JSONL file (plain or gzipped).

Converts a list of reports to newline-delimited JSON (JSONL).

Functions

export(reports, output_dir, opts \\ [])

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

Exports a list of analysis reports to the given directory.

Each report should be a map as returned by AnalyzerModule.analyze/3. Creates manifest.json and cache.jsonl.gz in output_dir.

read_jsonl(path)

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

Reads analysis reports from a JSONL file (plain or gzipped).

reports_to_jsonl(reports)

@spec reports_to_jsonl([map()]) :: binary()

Converts a list of reports to newline-delimited JSON (JSONL).