pub fn load_api_catalog(
fetcher: &dyn CatalogHttpClient,
) -> Result<(ApiCatalog, Vec<CacheWarning>), CacheError>Expand description
Load the API catalog from cache or fetch if expired.
This function:
- Checks if a cached catalog exists
- If cached and not expired, returns the cached version
- If expired or missing, fetches a fresh catalog from the API
- 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.
ยงReturns
Returns the catalog along with any warnings encountered during loading. Warnings should be emitted by the caller at the I/O boundary.