pkg/blobinfocache/boltdb/boltdb.go
func (bdc *cache) appendReplacementCandidates(candidates []prioritize.CandidateWithTime, scopeBucket *bolt.Bucket, digest digest.Digest) []prioritize.CandidateWithTime {
	b := scopeBucket.Bucket([]byte(digest.String()))
	if b == nil {
		return candidates
	}
	_ = b.ForEach(func(k, v []byte) error {
		t := time.Time{}
		if err := t.UnmarshalBinary(v); err != nil {
			return err
		}
		candidates = append(candidates, prioritize.CandidateWithTime{
			Candidate: types.BICReplacementCandidate{
				Digest:   digest,
				Location: types.BICLocationReference{Opaque: string(k)},
			},
			LastSeen: t,
		})
		return nil
	}) // FIXME? Log error (but throttle the log volume on repeated accesses)?
	return candidates
}
func (bdc *cache) appendReplacementCandidates(candidates []prioritize.CandidateWithTime, scopeBucket *bolt.Bucket, digest digest.Digest) []prioritize.CandidateWithTime {
	b := scopeBucket.Bucket([]byte(digest.String()))
	if b == nil {
		return candidates
	}
	_ = b.ForEach(func(k, v []byte) error {
		t := time.Time{}
		if err := t.UnmarshalBinary(v); err != nil {
			return err
		}
		candidates = append(candidates, prioritize.CandidateWithTime{
			Candidate: types.BICReplacementCandidate{
				Digest:   digest,
				Location: types.BICLocationReference{Opaque: string(k)},
			},
			LastSeen: t,
		})
		return nil
	}) // FIXME? Log error (but throttle the log volume on repeated accesses)?
	return candidates
}
func ( bdc * cache ) appendReplacementCandidates ( candidates [ ] prioritize . CandidateWithTime , scopeBucket * bolt . Bucket , digest digest . Digest ) [ ] prioritize . CandidateWithTime { b := scopeBucket . Bucket ( [ ] byte ( digest . String ( ) ) ) if b == nil { return candidates } _ = b . ForEach ( func ( k , v [ ] byte ) error { t := time . Time { } if err := t . UnmarshalBinary ( v ) ; err != nil { return err } candidates = append ( candidates , prioritize . CandidateWithTime { Candidate : types . BICReplacementCandidate { Digest : digest , Location : types . BICLocationReference { Opaque : string ( k ) } , } , LastSeen : t , } ) return nil } ) // FIXME? Log error (but throttle the log volume on repeated accesses)? return candidates }
// appendReplacementCandiates creates prioritize.CandidateWithTime values for digest in scopeBucket, and returns the result of appending them to candidates.
appendReplacementCandiates creates prioritize . CandidateWithTime values for digest in scopeBucket and returns the result of appending them to candidates .