Documentation ¶
Overview ¶
This package implements an image metadata cache given a backing k-v store.
The interface `Client` stands in for the k-v store (e.g., memcached, in the subpackage); `Cache` implements registry.Registry given a `Client`.
The `Warmer` is for continually refreshing the cache by fetching new metadata from the original image registries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotCached = &fluxerr.Error{ Type: fluxerr.Missing, Err: errors.New("item not in cache"), Help: `Image not yet cached It takes time to initially cache all the images. Please wait. If you have waited for a long time, check the flux logs. Potential reasons for the error are: no internet, no cache, error with the remote repository. `, } )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
Reader Reader
}
Cache is a local cache of image metadata.
type Client ¶
func InstrumentClient ¶
type ImageRepository ¶
ImageRepository holds the last good information on an image repository.
Whenever we successfully fetch a full set of image info, `LastUpdate` and `Images` shall each be assigned a value, and `LastError` will be cleared.
If we cannot for any reason obtain a full set of image info, `LastError` shall be assigned a value, and the other fields left alone.
It's possible to have all fields populated: this means at some point it was successfully fetched, but since then, there's been an error. It's then up to the caller to decide what to do with the value (show the images, but also indicate there's a problem, for example).
type Keyer ¶
type Keyer interface {
Key() string
}
An interface to provide the key under which to store the data Use the full path to image for the memcache key because there might be duplicates from other registries
func NewManifestKey ¶
func NewManifestKey(image image.CanonicalRef) Keyer
func NewRepositoryKey ¶
func NewRepositoryKey(repo image.CanonicalName) Keyer
type StringSet ¶
type StringSet map[string]struct{}
StringSet is a set of strings.
func NewStringSet ¶
NewStringSet returns a StringSet containing exactly the strings given as arguments.
type Warmer ¶
type Warmer struct { Trace bool Priority chan image.Name Notify func() // contains filtered or unexported fields }
Warmer refreshes the information kept in the cache from remote registries.