func NewWarmer(cf registry.ClientFactory, cacheClient Client, burst int) (*Warmer, error) {
	if cf == nil || cacheClient == nil || burst <= 0 {
		return nil, errors.New("arguments must be non-nil (or > 0 in the case of burst)")
	}
	return &Warmer{
		clientFactory: cf,
		cache:         cacheClient,
		burst:         burst,
	}, nil
}
NewWarmer creates cache warmer that (when Loop is invoked) will
periodically refresh the values kept in the cache.
package cache
import (
	"context"
	"strings"
	"sync"
	"time"
	"github.com/go-kit/kit/log"
	"github.com/pkg/errors"
	"github.com/fluxcd/flux/pkg/image"
	"github.com/fluxcd/flux/pkg/registry"
)
const askForNewImagesInterval = time.Minute
const initialRefresh = 1 * time.Hour
const minRefresh = 5 * time.Minute
const maxRefresh = 7 * 24 * time.Hour
const excludedRefresh = 24 * time.Hour
const repoRefresh = maxRefresh
func clipRefresh(r time.Duration) time.Duration {
	if r > maxRefresh {
		return maxRefresh
	}
	if r < minRefresh {
		return minRefresh
	}
	return r
}
type Warmer struct {
	clientFactory registry.ClientFactory
	cache         Client
	burst         int
	Trace         bool
	Priority      chan image.Name
	Notify        func()
}