pub trait CatalogHttpClient: Send + Sync {
// Required method
fn fetch_api_catalog(
&self,
ttl_seconds: u64,
) -> Result<(ApiCatalog, Vec<CacheWarning>), CacheError>;
}Expand description
Trait for fetching the OpenCode API catalog.
This trait enables dependency injection for catalog fetching, allowing tests to provide mock implementations that don’t make network calls.
Required Methods§
Sourcefn fetch_api_catalog(
&self,
ttl_seconds: u64,
) -> Result<(ApiCatalog, Vec<CacheWarning>), CacheError>
fn fetch_api_catalog( &self, ttl_seconds: u64, ) -> Result<(ApiCatalog, Vec<CacheWarning>), CacheError>
Fetch the API catalog JSON and parse it.