kithara-net 0.0.1-alpha4

Streaming HTTP for audio: retry, timeout, byte ranges.
Documentation

crates.io docs.rs License

kithara-net

HTTP client with retry, timeout, and streaming. Wraps reqwest behind the Net trait, with a TimeoutNet decorator and a MockNet for tests.

Usage

use kithara_net::{HttpClient, Net, NetOptions};
use kithara_platform::CancelToken;

let client = HttpClient::new(NetOptions::default(), CancelToken::never());
let bytes = client.get_bytes(url, None).await?;        // None = no extra headers
let created = client.post_bytes(url, body, None).await?; // POST bytes, read the response body
let stream = client.stream(url, None).await?;

Decorators compose via the NetExt extension trait: with_retry adds exponential-backoff retry, with_timeout wraps every call in TimeoutNet<N>.

Key Types

Integration

Used by kithara-file and kithara-hls for all HTTP operations. MockNet (behind the mock feature) enables deterministic testing without network access.

See CONTEXT.md for detailed contracts, invariants, and internals.