use crate::{
image::{copy, Artifact, Image, OciArchive, RemoteBuilder},
ImageName,
};
use anyhow::Result;
use std::path::Path;
mod auth;
mod client;
pub use auth::*;
pub use client::Client;
pub use oci_spec::image::MediaType;
pub fn push_image(path: &Path) -> Result<()> {
let mut oci_archive = OciArchive::new(path)?;
let image_name = oci_archive.get_name()?;
let remote = RemoteBuilder::new(image_name)?;
copy(&mut oci_archive, remote)?;
Ok(())
}
pub fn get_image(image_name: &ImageName, overwrite: bool) -> Result<()> {
let mut artifact = Artifact::from_remote(image_name.clone())?;
artifact.unpack(overwrite)?;
Ok(())
}