use crate::http_client::HttpClient;
use std::sync::Arc;
use tokio::io::AsyncRead;
mod load;
pub use load::Load;
mod pull;
pub use pull::Pull;
#[derive(Debug)]
pub struct Images {
http_client: Arc<HttpClient>,
}
impl Images {
pub(crate) fn new(http_client: Arc<HttpClient>) -> Self {
Self { http_client }
}
pub fn load<'a>(&'a self, tar_archive: impl AsyncRead + 'a) -> Load<'a> {
Load::new(&self.http_client, tar_archive)
}
#[must_use]
pub fn pull<'a>(&'a self, name: &'a str) -> Pull<'a> {
Pull::new(&self.http_client, name)
}
}