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 ¶
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.