Documentation ¶
Overview ¶
Package prioritize provides utilities for 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) []types.BICReplacementCandidate
DestructivelyPrioritizeReplacementCandidates consumes AND DESTROYS an array of possible replacement candidates with their last known existence times, the primary digest the user actually asked for, and the corresponding uncompressed digest (if known, possibly equal to the primary digest), and 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 CandidateWithTime ¶
type CandidateWithTime struct { Candidate types.BICReplacementCandidate // The replacement candidate LastSeen time.Time // Time the candidate was last known to exist (either read or written) }
CandidateWithTime is the input to types.BICReplacementCandidate prioritization.