Documentation
¶
Index ¶
- type CacheStats
- type LayerCache
- func (lc *LayerCache) Clean() error
- func (lc *LayerCache) Exists(diffID string) bool
- func (lc *LayerCache) Get(diffID string) (io.ReadCloser, error)
- func (lc *LayerCache) GetStats() *CacheStats
- func (lc *LayerCache) List() []*LayerMetadata
- func (lc *LayerCache) Prune(maxAge time.Duration) (int, int64, error)
- func (lc *LayerCache) Put(diffID string, reader io.Reader, imageRef string, size int64) error
- type LayerMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheStats ¶
type CacheStats struct {
TotalSize int64 // Total size of all cached layers
LayerCount int // Number of cached layers
CacheHits int64 // Number of cache hits (not persisted)
CacheMisses int64 // Number of cache misses (not persisted)
LastPruneAt time.Time
}
CacheStats contains statistics about the cache
type LayerCache ¶
type LayerCache struct {
// contains filtered or unexported fields
}
LayerCache manages the local layer cache
func NewLayerCache ¶
func NewLayerCache(enabled bool) (*LayerCache, error)
NewLayerCache creates a new layer cache
func (*LayerCache) Exists ¶
func (lc *LayerCache) Exists(diffID string) bool
Exists checks if a layer exists in the cache
func (*LayerCache) Get ¶
func (lc *LayerCache) Get(diffID string) (io.ReadCloser, error)
Get retrieves a layer from the cache
func (*LayerCache) GetStats ¶
func (lc *LayerCache) GetStats() *CacheStats
GetStats returns cache statistics
func (*LayerCache) List ¶
func (lc *LayerCache) List() []*LayerMetadata
List returns all cached layers
type LayerMetadata ¶
type LayerMetadata struct {
DiffID string `json:"diffid"` // Uncompressed digest (cache key)
Digest string `json:"digest"` // Compressed digest
Size int64 `json:"size"` // Uncompressed size
ImageRef string `json:"image_ref"` // Source image reference (e.g., "alpine:3.20")
LastAccess time.Time `json:"last_access"` // Last time this layer was accessed
CreatedAt time.Time `json:"created_at"` // When this layer was first cached
}
LayerMetadata contains metadata about a cached layer
Click to show internal directories.
Click to hide internal directories.