pub struct ImageProxy { /* private fields */ }
Expand description
Manage a child process proxy to fetch container images.
Implementations§
Source§impl ImageProxy
impl ImageProxy
Sourcepub async fn new() -> Result<Self>
pub async fn new() -> Result<Self>
Create an image proxy that fetches the target image, using default configuration.
Sourcepub async fn new_with_config(config: ImageProxyConfig) -> Result<Self>
pub async fn new_with_config(config: ImageProxyConfig) -> Result<Self>
Create an image proxy that fetches the target image
pub async fn open_image(&self, imgref: &str) -> Result<OpenedImage>
pub async fn open_image_optional( &self, imgref: &str, ) -> Result<Option<OpenedImage>>
pub async fn close_image(&self, img: &OpenedImage) -> Result<()>
Sourcepub async fn fetch_manifest_raw_oci(
&self,
img: &OpenedImage,
) -> Result<(String, Vec<u8>)>
pub async fn fetch_manifest_raw_oci( &self, img: &OpenedImage, ) -> Result<(String, Vec<u8>)>
Fetch the manifest as raw bytes, converted to OCI if necessary. The original digest of the unconverted manifest is also returned. For more information on OCI manifests, see https://github.com/opencontainers/image-spec/blob/main/manifest.md
Sourcepub async fn fetch_manifest(
&self,
img: &OpenedImage,
) -> Result<(String, ImageManifest)>
pub async fn fetch_manifest( &self, img: &OpenedImage, ) -> Result<(String, ImageManifest)>
Fetch the manifest. For more information on OCI manifests, see https://github.com/opencontainers/image-spec/blob/main/manifest.md
Sourcepub async fn fetch_config_raw(&self, img: &OpenedImage) -> Result<Vec<u8>>
pub async fn fetch_config_raw(&self, img: &OpenedImage) -> Result<Vec<u8>>
Fetch the config. For more information on OCI config, see https://github.com/opencontainers/image-spec/blob/main/config.md
Sourcepub async fn fetch_config(
&self,
img: &OpenedImage,
) -> Result<ImageConfiguration>
pub async fn fetch_config( &self, img: &OpenedImage, ) -> Result<ImageConfiguration>
Fetch the config. For more information on OCI config, see https://github.com/opencontainers/image-spec/blob/main/config.md
Sourcepub async fn get_blob(
&self,
img: &OpenedImage,
digest: &Digest,
size: u64,
) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
pub async fn get_blob( &self, img: &OpenedImage, digest: &Digest, size: u64, ) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
Fetch a blob identified by e.g. sha256:<digest>
.
https://github.com/opencontainers/image-spec/blob/main/descriptor.md
The requested size and digest are verified (by the proxy process).
Note that because of the implementation details of this function, you should
[futures::join!
] the returned futures instead of polling one after the other. The
secondary “driver” future will only return once everything has been read from
the reader future.
Sourcepub async fn get_descriptor(
&self,
img: &OpenedImage,
descriptor: &Descriptor,
) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
pub async fn get_descriptor( &self, img: &OpenedImage, descriptor: &Descriptor, ) -> Result<(impl AsyncBufRead + Send + Unpin, impl Future<Output = Result<()>> + Unpin + '_)>
Fetch a descriptor. The requested size and digest are verified (by the proxy process).
Sourcepub async fn get_layer_info(
&self,
img: &OpenedImage,
) -> Result<Option<Vec<ConvertedLayerInfo>>>
pub async fn get_layer_info( &self, img: &OpenedImage, ) -> Result<Option<Vec<ConvertedLayerInfo>>>
Returns data that can be used to find the “diffid” corresponding to a particular layer.