pub struct ApiClient { /* private fields */ }Expand description
HTTP client for interacting with the Carp registry API
Implementations§
Source§impl ApiClient
impl ApiClient
Sourcepub fn new(config: &Config) -> CarpResult<Self>
pub fn new(config: &Config) -> CarpResult<Self>
Create a new API client from configuration
Sourcepub fn with_retry_config(
config: &Config,
retry_config: RetryConfig,
) -> CarpResult<Self>
pub fn with_retry_config( config: &Config, retry_config: RetryConfig, ) -> CarpResult<Self>
Create a new API client with custom retry configuration
Sourcepub fn with_api_key(self, api_key: Option<String>) -> Self
pub fn with_api_key(self, api_key: Option<String>) -> Self
Set API key at runtime (overrides config)
Sourcepub async fn search(
&self,
query: &str,
limit: Option<usize>,
exact: bool,
) -> CarpResult<SearchResponse>
pub async fn search( &self, query: &str, limit: Option<usize>, exact: bool, ) -> CarpResult<SearchResponse>
Search for agents in the registry
Sourcepub async fn get_agent_download(
&self,
name: &str,
version: Option<&str>,
) -> CarpResult<AgentDownload>
pub async fn get_agent_download( &self, name: &str, version: Option<&str>, ) -> CarpResult<AgentDownload>
Get download information for a specific agent
Sourcepub async fn download_agent(&self, download_url: &str) -> CarpResult<Bytes>
pub async fn download_agent(&self, download_url: &str) -> CarpResult<Bytes>
Download agent content
Sourcepub async fn upload(
&self,
request: UploadAgentRequest,
) -> CarpResult<UploadAgentResponse>
pub async fn upload( &self, request: UploadAgentRequest, ) -> CarpResult<UploadAgentResponse>
Upload an agent to the registry via JSON
Sourcepub async fn publish(
&self,
_request: PublishRequest,
_content: Vec<u8>,
) -> CarpResult<PublishResponse>
pub async fn publish( &self, _request: PublishRequest, _content: Vec<u8>, ) -> CarpResult<PublishResponse>
Publish an agent to the registry (currently disabled for security)
Sourcepub async fn authenticate(
&self,
username: &str,
password: &str,
) -> CarpResult<AuthResponse>
pub async fn authenticate( &self, username: &str, password: &str, ) -> CarpResult<AuthResponse>
Authenticate with the registry
Sourcepub async fn health_check(&self) -> CarpResult<HealthResponse>
pub async fn health_check(&self) -> CarpResult<HealthResponse>
Check the health status of the API
Auto Trait Implementations§
impl Freeze for ApiClient
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl !UnwindSafe for ApiClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more