resolver

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResolveResult

type ResolveResult struct {
	Resource        resource.Resource
	Snapshot        snapshot.Snapshot
	Materialization materialization.Materialization
	Content         []byte
	Decision        policy.Decision
	// Ref is the tag this resolve was pinned to ("" for a plain URI).
	Ref string
}

ResolveResult is what a single Resolve call produces. Manifest-entry creation is deliberately NOT part of this result — that's run.Builder's job, since Resolve backs both `readproof get` and `run.Builder.Mount`.

type Resolver

type Resolver struct {
	Resources        resource.Store
	Snapshots        snapshot.Store
	Materializations materialization.Store
	Tags             tag.Store
	Blobs            blob.Store
	Sources          *source.Registry
	Materializer     materialization.Materializer
	// Clock defaults to time.Now().UTC() when nil; overridable for tests.
	Clock func() time.Time
}

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, rawURI string) (ResolveResult, error)

Resolve resolves a single reference, which may carry a trailing "@<tag>" (see resource.SplitRef). The signature is unchanged from v0.1 — every existing caller passing a bare readproof:// URI keeps working — so this is also the one place a combined "uri@ref" string is taken apart.

func (*Resolver) ResolveRef

func (r *Resolver) ResolveRef(ctx context.Context, uri, ref string) (result ResolveResult, err error)

ResolveRef runs the full resolution pipeline for a bare URI plus an optional tag ref: resource lookup -> (tag lookup | policy/freshness evaluation -> fetch-or-reuse -> snapshot creation) -> get-or-create materialization -> result. Every stage is traced (span names match spec §35: readproof.resolve, readproof.resource.lookup, readproof.policy.evaluate, readproof.cache.lookup, readproof.source.fetch, readproof.snapshot.create, readproof.materialize, plus readproof.tag.lookup for the tag path) and the top-level call is metered. Resolved content is never attached to spans/metrics.

With a non-empty ref the resource's Policy is deliberately NOT consulted and the source is never contacted: the caller named one exact snapshot.

Jump to

Keyboard shortcuts

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