blobfetch

package
v0.30.0-rc1 Latest Latest
Warning

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

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

Documentation

Overview

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. It is factored out of the containerblob source so other consumers (for example the git-bundle flow on the git source) can reuse the same resolution logic without depending on the source implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchBlob

func FetchBlob(ctx context.Context, g session.Group, opt FetchOpt) (io.ReadCloser, digest.Digest, error)

FetchBlob opens a read stream for the requested blob. The caller owns the returned ReadCloser and must Close it. The returned digest is the blob digest from the locator (echoed for convenience).

Types

type FetchOpt

type FetchOpt struct {
	// Scheme identifies the source kind. Must be one of
	// srctypes.DockerImageBlobScheme or srctypes.OCIBlobScheme.
	Scheme string
	// Ref is the image-ref form of the blob, i.e. "<name>@<digest>" for
	// registry blobs, or the reference body accepted by the containerd
	// reference parser for OCI-layout blobs.
	Ref string
	// Digest is the blob digest to retrieve.
	Digest digest.Digest
	// RegistryHosts is used when Scheme is DockerImageBlobScheme.
	RegistryHosts docker.RegistryHosts
	// SessionManager is used to reach the client when Scheme is
	// OCIBlobScheme.
	SessionManager *session.Manager
	// SessionID, if set, pins the OCI-layout fetch to a specific client
	// session.
	SessionID string
	// StoreID is the client-side OCI-layout store name. Required for
	// Scheme == OCIBlobScheme.
	StoreID string
}

FetchOpt describes how to resolve a blob.

Jump to

Keyboard shortcuts

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