Documentation ¶
Overview ¶
Package prioritize provides utilities for filtering and prioritizing locations in types.BlobInfoCache.CandidateLocations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestructivelyPrioritizeReplacementCandidates ¶
func DestructivelyPrioritizeReplacementCandidates(cs []CandidateWithTime, primaryDigest, uncompressedDigest digest.Digest) []blobinfocache.BICReplacementCandidate2
DestructivelyPrioritizeReplacementCandidates consumes AND DESTROYS an array of possible replacement candidates with their last known existence times, the primary digest the user actually asked for, the corresponding uncompressed digest (if known, possibly equal to the primary digest) returns an appropriately prioritized and/or trimmed result suitable for a return value from types.BlobInfoCache.CandidateLocations.
WARNING: The array of candidates is destructively modified. (The implementation of this function could of course make a copy, but all CandidateLocations implementations build the slice of candidates only for the single purpose of calling this function anyway.)
Types ¶
type CandidateTemplate ¶ added in v5.32.1
type CandidateTemplate struct {
// contains filtered or unexported fields
}
CandidateTemplate is a subset of BICReplacementCandidate2 with data related to a specific digest, which can be later combined with information about a location.
func CandidateTemplateWithCompression ¶ added in v5.32.1
func CandidateTemplateWithCompression(v2Options *blobinfocache.CandidateLocations2Options, digest digest.Digest, data blobinfocache.DigestCompressorData) *CandidateTemplate
CandidateTemplateWithCompression returns a CandidateTemplate if a blob with data is acceptable for a CandidateLocations* call with v2Options.
v2Options can be set to nil if the call is CandidateLocations (i.e. compression is not required to be known); if not nil, the call is assumed to be CandidateLocations2.
func (CandidateTemplate) CandidateWithLocation ¶ added in v5.32.1
func (template CandidateTemplate) CandidateWithLocation(location types.BICLocationReference, lastSeen time.Time) CandidateWithTime
CandidateWithLocation returns a complete CandidateWithTime combining (template from CandidateTemplateWithCompression, location, lastSeen)
func (CandidateTemplate) CandidateWithUnknownLocation ¶ added in v5.32.1
func (template CandidateTemplate) CandidateWithUnknownLocation() CandidateWithTime
CandidateWithUnknownLocation returns a complete CandidateWithTime for a template from CandidateTemplateWithCompression and an unknown location.
type CandidateWithTime ¶
type CandidateWithTime struct {
// contains filtered or unexported fields
}
CandidateWithTime is the input to types.BICReplacementCandidate prioritization.