Documentation
¶
Index ¶
- type BlobCache
- func (bc *BlobCache) Clean() error
- func (bc *BlobCache) Exists(digest string) bool
- func (bc *BlobCache) Get(digest string) (io.ReadCloser, error)
- func (bc *BlobCache) GetMetadata(digest string) (*BlobMetadata, error)
- func (bc *BlobCache) GetStats() (totalSize int64, blobCount int)
- func (bc *BlobCache) List() []*BlobMetadata
- func (bc *BlobCache) Prune(maxAge time.Duration) (int, int64, error)
- func (bc *BlobCache) Put(digest, diffID string, reader io.Reader, imageRef string) error
- type BlobCacheIndex
- type BlobMetadata
- 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 BlobCache ¶ added in v0.6.2
type BlobCache struct {
// contains filtered or unexported fields
}
BlobCache manages the local blob cache Unlike the old LayerCache, this stores registry blobs directly (compressed) without any decompression/recompression, using digest as the key
func NewBlobCache ¶ added in v0.6.2
NewBlobCache creates a new blob cache
func (*BlobCache) Get ¶ added in v0.6.2
func (bc *BlobCache) Get(digest string) (io.ReadCloser, error)
Get retrieves a blob from the cache Returns an io.ReadCloser for the compressed blob
func (*BlobCache) GetMetadata ¶ added in v0.6.2
func (bc *BlobCache) GetMetadata(digest string) (*BlobMetadata, error)
GetMetadata returns metadata for a blob
func (*BlobCache) List ¶ added in v0.6.2
func (bc *BlobCache) List() []*BlobMetadata
List returns all cached blobs
type BlobCacheIndex ¶ added in v0.6.2
type BlobCacheIndex struct {
Version string `json:"version"` // Index format version
Blobs map[string]*BlobMetadata `json:"blobs"` // digest -> metadata
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
BlobCacheIndex contains the index of all cached blobs
type BlobMetadata ¶ added in v0.6.2
type BlobMetadata struct {
Digest string `json:"digest"` // Compressed digest (cache key, with sha256: prefix)
DiffID string `json:"diffid"` // Uncompressed digest
Size int64 `json:"size"` // Compressed size
ImageRefs []string `json:"image_refs"` // Source image references (multiple images may share this blob)
LastAccess time.Time `json:"last_access"` // Last time this blob was accessed
CreatedAt time.Time `json:"created_at"` // When this blob was first cached
}
BlobMetadata contains metadata about a cached blob
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