package cache
import "github.com/docker/distribution/registry/storage/cache"
Package cache provides facilities to speed up access to the storage backend.
Index ¶
- func NewCachedBlobStatter(cache distribution.BlobDescriptorService, backend distribution.BlobDescriptorService) distribution.BlobDescriptorService
- func NewCachedBlobStatterWithMetrics(cache distribution.BlobDescriptorService, backend distribution.BlobDescriptorService, tracker MetricsTracker) distribution.BlobStatter
- func ValidateDescriptor(desc distribution.Descriptor) error
- type BlobDescriptorCacheProvider
- type Logger
- type Metrics
- type MetricsTracker
Functions ¶
func NewCachedBlobStatter ¶
func NewCachedBlobStatter(cache distribution.BlobDescriptorService, backend distribution.BlobDescriptorService) distribution.BlobDescriptorService
NewCachedBlobStatter creates a new statter which prefers a cache and falls back to a backend.
func NewCachedBlobStatterWithMetrics ¶
func NewCachedBlobStatterWithMetrics(cache distribution.BlobDescriptorService, backend distribution.BlobDescriptorService, tracker MetricsTracker) distribution.BlobStatter
NewCachedBlobStatterWithMetrics creates a new statter which prefers a cache and falls back to a backend. Hits and misses will send to the tracker.
func ValidateDescriptor ¶
func ValidateDescriptor(desc distribution.Descriptor) error
ValidateDescriptor provides a helper function to ensure that caches have common criteria for admitting descriptors.
Types ¶
type BlobDescriptorCacheProvider ¶
type BlobDescriptorCacheProvider interface { distribution.BlobDescriptorService RepositoryScoped(repo string) (distribution.BlobDescriptorService, error) }
BlobDescriptorCacheProvider provides repository scoped BlobDescriptorService cache instances and a global descriptor cache.
type Logger ¶
type Logger interface { Errorf(format string, args ...interface{}) }
Logger can be provided on the MetricsTracker to log errors.
Usually, this is just a proxy to dcontext.GetLogger.
type Metrics ¶
Metrics is used to hold metric counters related to the number of times a cache was hit or missed.
type MetricsTracker ¶
MetricsTracker represents a metric tracker which simply counts the number of hits and misses.
Source Files ¶
cache.go cachedblobdescriptorstore.go
Directories ¶
Path | Synopsis |
---|---|
registry/storage/cache/cachecheck | |
registry/storage/cache/memory | |
registry/storage/cache/redis |
- Version
- v2.8.3+incompatible (latest)
- Published
- Oct 2, 2023
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 day ago –
Tools for package owners.