Documentation ¶
Overview ¶
Package assoc defines data types for associative maps used within Reflow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assoc ¶
type Assoc interface { // Store unconditionally stores the association k, v. // Zero values indicate that the association is to be deleted. Store(ctx context.Context, kind Kind, k, v digest.Digest) error // Get returns the digest associated with key digest k and the // provided kind. Get returns an errors.NotExist when no such // mapping exists. Get expands the provided key when it is abbreviated, // and returns the expanded key when appropriate. Get(ctx context.Context, kind Kind, k digest.Digest) (kexp, v digest.Digest, err error) // BatchGet fetches a batch of keys. The result or error is set for each key. // Global errors (such as context errors or unrecoverable system errors) // are returned. Errors that can be attributable to a single fetch is returned // as that key's error. BatchGet(ctx context.Context, batch Batch) error // CollectWithThreshold removes from this assoc any objects whose keys are not in the // liveset and is either in the dead set or its creation times are not more recent than the threshold time. CollectWithThreshold(ctx context.Context, live, dead liveset.Liveset, threshold time.Time, rate int64, dryrun bool) error // Count returns an estimate of the number of associations in this mapping. Count(ctx context.Context) (int64, error) // Scan calls the handler function for every association in the mapping. // Note that the handler function may be called asynchronously from multiple threads. Scan(ctx context.Context, kinds []Kind, handler MappingHandler) error // Delete deletes the key k unconditionally from the provided assoc. Delete(ctx context.Context, k digest.Digest) error }
An Assoc is an associative array mapping digests to other digests. Mappings are also assigned a kind, and can thus be expanded to store multiple types of mapping for each key.
type Batch ¶
Batch is map of keys, fetched together.
type MappingHandler ¶
type MappingHandler interface { // HandleMapping handles a scanned association. HandleMapping(ctx context.Context, k digest.Digest, v map[Kind]digest.Digest, lastAccessTime time.Time, labels []string) }
MappingHandler is an interface for handling a mapping while scanning.
Click to show internal directories.
Click to hide internal directories.