Documentation ¶
Overview ¶
Package cache provides facilities to speed up access to the storage backend.
Index ¶
- func CheckBlobDescriptorCache(t *testing.T, provider BlobDescriptorCacheProvider)
- func NewCachedBlobStatter(cache distribution.BlobDescriptorService, ...) distribution.BlobDescriptorService
- func NewCachedBlobStatterWithMetrics(cache distribution.BlobDescriptorService, ...) distribution.BlobStatter
- func ValidateDescriptor(desc distribution.Descriptor) error
- type BlobDescriptorCacheProvider
- type Metrics
- type MetricsTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckBlobDescriptorCache ¶ added in v2.1.0
func CheckBlobDescriptorCache(t *testing.T, provider BlobDescriptorCacheProvider)
CheckBlobDescriptorCache takes a cache implementation through a common set of operations. If adding new tests, please add them here so new implementations get the benefit. This should be used for unit tests.
func NewCachedBlobStatter ¶ added in v2.1.0
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 ¶ added in v2.1.0
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 ¶ added in v2.1.0
func ValidateDescriptor(desc distribution.Descriptor) error
ValidateDescriptor provides a helper function to ensure that caches have common criteria for admitting descriptors.
Types ¶
type BlobDescriptorCacheProvider ¶ added in v2.1.0
type BlobDescriptorCacheProvider interface { distribution.BlobDescriptorService RepositoryScoped(repo string) (distribution.BlobDescriptorService, error) }
BlobDescriptorCacheProvider provides repository scoped BlobDescriptorService cache instances and a global descriptor cache.
type Metrics ¶ added in v2.1.0
Metrics is used to hold metric counters related to the number of times a cache was hit or missed.
type MetricsTracker ¶ added in v2.1.0
type MetricsTracker interface { Hit() Miss() Metrics() Metrics }
MetricsTracker represents a metric tracker which simply counts the number of hits and misses.