Help us shape the future of Go! Take the 2026 Go Developer Survey

source

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 412

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identifier

type Identifier interface {
	// Scheme returns the scheme of the identifier so that it can be routed back
	// to an appropriate Source.
	Scheme() string

	// Capture records the provenance of the identifier.
	Capture(dest *provenance.Capture, pin string) error
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() (*Manager, error)

func (*Manager) Identifier added in v0.13.0

func (sm *Manager) Identifier(op *pb.Op_Source, platform *pb.Platform) (Identifier, error)

func (*Manager) Register

func (sm *Manager) Register(src Source)

func (*Manager) Resolve

func (sm *Manager) Resolve(ctx context.Context, id Identifier, sessM *session.Manager, vtx solver.Vertex) (SourceInstance, error)

type Source

type Source interface {
	// Schemes returns a list of SourceOp identifier schemes that this source
	// should match.
	Schemes() []string

	// Identifier constructs an Identifier from the given scheme, ref, and attrs,
	// all of which come from a SourceOp.
	Identifier(scheme, ref string, attrs map[string]string, platform *pb.Platform) (Identifier, error)

	// Resolve constructs an instance of the source from an Identifier.
	Resolve(ctx context.Context, id Identifier, sm *session.Manager, vtx solver.Vertex) (SourceInstance, error)
}

Source implementations provide "root" vertices in the graph that can be constructed from a URI-like string and arbitrary attrs.

type SourceInstance

type SourceInstance interface {
	// CacheKey returns the cache key for the instance.
	CacheKey(ctx context.Context, jobCtx solver.JobContext, index int) (key, pin string, opts solver.CacheOpts, done bool, err error)

	// Snapshot creates a cache ref for the instance. May return a nil ref if source points to empty content, e.g. image without any layers.
	Snapshot(ctx context.Context, jobCtx solver.JobContext) (cache.ImmutableRef, error)
}

SourceInstance represents a cacheable vertex created by a Source.

Directories

Path Synopsis
blobfetch
Package blobfetch provides a shared helper for resolving a single content-addressable blob from either a docker-image registry or an OCI layout content store, identified by its digest.
Package blobfetch provides a shared helper for resolving a single content-addressable blob from either a docker-image registry or an OCI layout content store, identified by its digest.
util

Jump to

Keyboard shortcuts

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