Skip to main content

load_api_catalog

Function load_api_catalog 

Source
pub fn load_api_catalog() -> Result<ApiCatalog, CacheError>
Expand description

Load the API catalog from cache or fetch if expired.

This function:

  1. Checks if a cached catalog exists
  2. If cached and not expired, returns the cached version
  3. If expired or missing, fetches a fresh catalog from the API
  4. Saves the fetched catalog to disk for future use

Gracefully degrades on network errors: if fetching fails but a stale cache exists (< 7 days old), it will be used with a warning.