pub struct DockerRegistry { /* private fields */ }Expand description
DockerRegistry is a client for interacting with Docker’s Registry HTTP API v2. It handles authentication, image manifest retrieval, and blob fetching.
See OCI distribution specification for more details on the manifest schema
Implementations§
Source§impl DockerRegistry
impl DockerRegistry
Sourcepub fn get_client(&self) -> &ClientWithMiddleware
pub fn get_client(&self) -> &ClientWithMiddleware
The HTTP client used to make requests to the Docker registry.
Sourcepub fn get_oci_dir(&self) -> &PathBuf
pub fn get_oci_dir(&self) -> &PathBuf
The path to the OCI directory where artifacts like repositories metadata and layers are stored.
Source§impl DockerRegistry
impl DockerRegistry
Sourcepub fn set_client(&mut self, val: ClientWithMiddleware) -> &mut Self
pub fn set_client(&mut self, val: ClientWithMiddleware) -> &mut Self
The HTTP client used to make requests to the Docker registry.
Sourcepub fn set_oci_dir(&mut self, val: PathBuf) -> &mut Self
pub fn set_oci_dir(&mut self, val: PathBuf) -> &mut Self
The path to the OCI directory where artifacts like repositories metadata and layers are stored.
Source§impl DockerRegistry
Creates a new instance of DockerRegistry with an HTTP client configured for retrying transient errors.
This client is used to interact with the Docker Registry HTTP API.
impl DockerRegistry
Creates a new instance of DockerRegistry with an HTTP client configured for retrying transient errors.
This client is used to interact with the Docker Registry HTTP API.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new DockerRegistry instance with the default artifacts directory (MONOCORE_HOME).
Sourcepub fn with_oci_dir(oci_dir: PathBuf) -> Self
pub fn with_oci_dir(oci_dir: PathBuf) -> Self
Creates a new DockerRegistry instance with a custom base path.
This is useful for testing or when you need to store OCI artifacts in a different location than the default MONOCORE_HOME.
§Arguments
oci_dir- The base path where OCI artifacts will be stored. The OCI directory structure will be created under this path.
Trait Implementations§
Source§impl AuthProvider for DockerRegistry
impl AuthProvider for DockerRegistry
Source§fn get_auth_material<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repository: &'life1 str,
service: &'life2 str,
scopes: &'life3 [&'life4 str],
) -> Pin<Box<dyn Future<Output = MonocoreResult<Self::AuthMaterial>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn get_auth_material<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
repository: &'life1 str,
service: &'life2 str,
scopes: &'life3 [&'life4 str],
) -> Pin<Box<dyn Future<Output = MonocoreResult<Self::AuthMaterial>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Gets the necessary authentication credentials for the given repository and tag.
Currently, Docker tokens expire after 300 seconds, so we need to re-authenticate after that period or just fetch new tokens on each request.
Source§type AuthMaterial = DockerAuthMaterial
type AuthMaterial = DockerAuthMaterial
Source§impl Debug for DockerRegistry
impl Debug for DockerRegistry
Source§impl Default for DockerRegistry
impl Default for DockerRegistry
Source§impl OciRegistryPull for DockerRegistry
impl OciRegistryPull for DockerRegistry
Source§fn pull_image<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
tag: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = MonocoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pull_image<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
tag: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = MonocoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn fetch_index<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
tag: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = MonocoreResult<ImageIndex>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_index<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
tag: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = MonocoreResult<ImageIndex>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn fetch_manifest<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
digest: &'life2 Digest,
) -> Pin<Box<dyn Future<Output = MonocoreResult<ImageManifest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_manifest<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
digest: &'life2 Digest,
) -> Pin<Box<dyn Future<Output = MonocoreResult<ImageManifest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn fetch_config<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
digest: &'life2 Digest,
) -> Pin<Box<dyn Future<Output = MonocoreResult<ImageConfiguration>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_config<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
digest: &'life2 Digest,
) -> Pin<Box<dyn Future<Output = MonocoreResult<ImageConfiguration>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn fetch_image_blob<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
digest: &'life2 Digest,
range: impl 'async_trait + RangeBounds<u64> + Send,
) -> Pin<Box<dyn Future<Output = MonocoreResult<BoxStream<'static, MonocoreResult<Bytes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_image_blob<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
repository: &'life1 str,
digest: &'life2 Digest,
range: impl 'async_trait + RangeBounds<u64> + Send,
) -> Pin<Box<dyn Future<Output = MonocoreResult<BoxStream<'static, MonocoreResult<Bytes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl Freeze for DockerRegistry
impl !RefUnwindSafe for DockerRegistry
impl Send for DockerRegistry
impl Sync for DockerRegistry
impl Unpin for DockerRegistry
impl !UnwindSafe for DockerRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more