prioritize

package
v3.0.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL