pub struct CacheManager { /* private fields */ }
Expand description
Cache manager for handling Docker/OCI image caching operations
Implementations§
Source§impl CacheManager
impl CacheManager
pub fn new(cache: Cache, logger: Logger) -> Self
pub fn with_config( cache: Cache, logger: Logger, config: CacheManagerConfig, ) -> Self
Sourcepub async fn extract_and_cache_from_tar(
&mut self,
tar_file: &str,
repository: &str,
reference: &str,
) -> Result<()>
pub async fn extract_and_cache_from_tar( &mut self, tar_file: &str, repository: &str, reference: &str, ) -> Result<()>
Extract from tar file and cache locally
Sourcepub async fn push_from_cache_with_source(
&mut self,
client: &RegistryClient,
source_repository: &str,
source_reference: &str,
target_repository: &str,
target_reference: &str,
token: &Option<String>,
) -> Result<()>
pub async fn push_from_cache_with_source( &mut self, client: &RegistryClient, source_repository: &str, source_reference: &str, target_repository: &str, target_reference: &str, token: &Option<String>, ) -> Result<()>
Push from cache to registry with separate source and target coordinates
Sourcepub async fn push_from_cache(
&mut self,
client: &RegistryClient,
repository: &str,
reference: &str,
token: &Option<String>,
) -> Result<()>
pub async fn push_from_cache( &mut self, client: &RegistryClient, repository: &str, reference: &str, token: &Option<String>, ) -> Result<()>
Push from cache to registry (same coordinates)
Sourcepub fn get_cache_stats(&self) -> Result<CacheStats>
pub fn get_cache_stats(&self) -> Result<CacheStats>
Get cache statistics
Sourcepub fn list_cached_images(&self) -> Vec<(String, String)>
pub fn list_cached_images(&self) -> Vec<(String, String)>
List all cached images
Sourcepub fn is_image_cached(&self, repository: &str, reference: &str) -> Result<bool>
pub fn is_image_cached(&self, repository: &str, reference: &str) -> Result<bool>
Check if image is cached
Sourcepub fn validate_cache_completeness(
&self,
repository: &str,
reference: &str,
) -> Result<()>
pub fn validate_cache_completeness( &self, repository: &str, reference: &str, ) -> Result<()>
Validate cache completeness for an image
Sourcepub fn get_image_blobs(
&self,
repository: &str,
reference: &str,
) -> Result<Vec<BlobInfo>>
pub fn get_image_blobs( &self, repository: &str, reference: &str, ) -> Result<Vec<BlobInfo>>
Get image blobs from cache
Sourcepub fn get_cache_mut(&mut self) -> &mut Cache
pub fn get_cache_mut(&mut self) -> &mut Cache
Get mutable cache reference (for external operations)
Trait Implementations§
Source§impl Cacheable for CacheManager
impl Cacheable for CacheManager
type Key = (String, String)
type Value = bool
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Self::Key,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Self::Key,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get from cache
Source§fn put<'life0, 'async_trait>(
&'life0 self,
_key: Self::Key,
_value: Self::Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
_key: Self::Key,
_value: Self::Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Put into cache
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Self::Key,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Self::Key,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if exists in cache
Source§impl Configurable<CacheManagerConfig> for CacheManager
impl Configurable<CacheManagerConfig> for CacheManager
Source§fn get_config(&self) -> &CacheManagerConfig
fn get_config(&self) -> &CacheManagerConfig
Get current configuration
Source§fn validate_config(config: &CacheManagerConfig) -> Result<()>
fn validate_config(config: &CacheManagerConfig) -> Result<()>
Validate configuration
Auto Trait Implementations§
impl Freeze for CacheManager
impl RefUnwindSafe for CacheManager
impl Send for CacheManager
impl Sync for CacheManager
impl Unpin for CacheManager
impl UnwindSafe for CacheManager
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
Mutably borrows from an owned value. Read more