Skip to main content

CatalogHttpClient

Trait CatalogHttpClient 

Source
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§

Source

fn fetch_api_catalog( &self, ttl_seconds: u64, ) -> Result<(ApiCatalog, Vec<CacheWarning>), CacheError>

Fetch the API catalog JSON and parse it.

Implementors§