chore
This commit is contained in:
+13
-1
@@ -23,6 +23,18 @@ impl Client {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_with_http_client(
|
||||
base_url: String,
|
||||
token: String,
|
||||
http_client: reqwest::Client,
|
||||
) -> Self {
|
||||
Self {
|
||||
base_url,
|
||||
token,
|
||||
http_client,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_proxy(self, proxy: String) -> reqwest::Result<Self> {
|
||||
let proxy = reqwest::Proxy::all(proxy)?;
|
||||
Ok(Self {
|
||||
@@ -154,7 +166,7 @@ impl<'t> Host<'t> {
|
||||
pub async fn asset(
|
||||
&self,
|
||||
asset_name: &str,
|
||||
) -> Result<impl Stream<Item = reqwest::Result<Bytes>>> {
|
||||
) -> Result<impl Stream<Item = reqwest::Result<Bytes>> + use<>> {
|
||||
let req = self.dls.get(format!("hosts/{}/{asset_name}", self.name))?;
|
||||
let resp = do_req(req, &self.dls.token).await?;
|
||||
Ok(resp.bytes_stream())
|
||||
|
||||
Reference in New Issue
Block a user