Lei.BatchCache (LowEndInsight v0.9.1)

Copy Markdown View Source

ETS-backed cache for batch dependency analysis results.

Stores analysis results keyed by {ecosystem, package, version} tuples for fast parallel lookups during batch SBOM analysis. Designed for sub-millisecond reads to meet the <500ms target for 50 dependencies.

Summary

Functions

Returns a specification to start this module under a supervisor.

Clear all entries from the batch cache.

Look up a cached analysis result by ecosystem, package, and version. Returns {:ok, entry} or {:error, :not_found | :expired}.

Perform parallel cache lookups for a list of dependencies. Returns a map of %{key => {:ok, entry} | {:error, reason}}.

Store an analysis result in the cache.

Returns cache statistics.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear()

Clear all entries from the batch cache.

get(ecosystem, package, version)

Look up a cached analysis result by ecosystem, package, and version. Returns {:ok, entry} or {:error, :not_found | :expired}.

multi_get(dependencies)

Perform parallel cache lookups for a list of dependencies. Returns a map of %{key => {:ok, entry} | {:error, reason}}.

put(ecosystem, package, version, result, opts \\ [])

Store an analysis result in the cache.

start_link(opts \\ [])

stats()

Returns cache statistics.