pub struct HttpClient { /* private fields */ }
Expand description
HTTP client for TACT protocol
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn new(region: Region, version: ProtocolVersion) -> Result<Self>
pub fn new(region: Region, version: ProtocolVersion) -> Result<Self>
Create a new HTTP client for the specified region and protocol version
Sourcepub fn with_client(
client: Client,
region: Region,
version: ProtocolVersion,
) -> Self
pub fn with_client( client: Client, region: Region, version: ProtocolVersion, ) -> Self
Create a new HTTP client with custom reqwest client
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Set the maximum number of retries for failed requests
Default is 0 (no retries) to maintain backward compatibility. Only network and connection errors are retried, not parsing errors.
Sourcepub fn with_initial_backoff_ms(self, initial_backoff_ms: u64) -> Self
pub fn with_initial_backoff_ms(self, initial_backoff_ms: u64) -> Self
Set the initial backoff duration in milliseconds
Default is 100ms. This is the base delay before the first retry.
Sourcepub fn with_max_backoff_ms(self, max_backoff_ms: u64) -> Self
pub fn with_max_backoff_ms(self, max_backoff_ms: u64) -> Self
Set the maximum backoff duration in milliseconds
Default is 10,000ms (10 seconds). Backoff will not exceed this value.
Sourcepub fn with_backoff_multiplier(self, backoff_multiplier: f64) -> Self
pub fn with_backoff_multiplier(self, backoff_multiplier: f64) -> Self
Set the backoff multiplier
Default is 2.0. The backoff duration is multiplied by this value after each retry.
Sourcepub fn with_jitter_factor(self, jitter_factor: f64) -> Self
pub fn with_jitter_factor(self, jitter_factor: f64) -> Self
Set the jitter factor (0.0 to 1.0)
Default is 0.1 (10% jitter). Adds randomness to prevent thundering herd.
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Set a custom user agent string
If not set, reqwest’s default user agent will be used.
Sourcepub fn version(&self) -> ProtocolVersion
pub fn version(&self) -> ProtocolVersion
Get the current protocol version
Sourcepub fn set_region(&mut self, region: Region)
pub fn set_region(&mut self, region: Region)
Set the region
Sourcepub async fn get_versions(&self, product: &str) -> Result<Response>
pub async fn get_versions(&self, product: &str) -> Result<Response>
Get versions manifest for a product (V1 protocol)
Sourcepub async fn get_cdns(&self, product: &str) -> Result<Response>
pub async fn get_cdns(&self, product: &str) -> Result<Response>
Get CDN configuration for a product (V1 protocol)
Sourcepub async fn get_bgdl(&self, product: &str) -> Result<Response>
pub async fn get_bgdl(&self, product: &str) -> Result<Response>
Get BGDL manifest for a product (V1 protocol)
Sourcepub async fn get_summary(&self) -> Result<Response>
pub async fn get_summary(&self) -> Result<Response>
Get product summary (V2 protocol)
Sourcepub async fn get_product(&self, product: &str) -> Result<Response>
pub async fn get_product(&self, product: &str) -> Result<Response>
Get product details (V2 protocol)
Sourcepub async fn download_file(
&self,
cdn_host: &str,
path: &str,
hash: &str,
) -> Result<Response>
pub async fn download_file( &self, cdn_host: &str, path: &str, hash: &str, ) -> Result<Response>
Download a file from CDN
Sourcepub async fn get_versions_parsed(
&self,
product: &str,
) -> Result<Vec<VersionEntry>>
pub async fn get_versions_parsed( &self, product: &str, ) -> Result<Vec<VersionEntry>>
Get parsed versions manifest for a product
Trait Implementations§
Source§impl Clone for HttpClient
impl Clone for HttpClient
Source§fn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more