private

package
v5.24.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadPartialRequestError

type BadPartialRequestError struct {
	Status string
}

BadPartialRequestError is returned by BlobChunkAccessor.GetBlobAt on an invalid request.

func (BadPartialRequestError) Error

func (e BadPartialRequestError) Error() string

type BlobChunkAccessor

type BlobChunkAccessor interface {
	// GetBlobAt returns a sequential channel of readers that contain data for the requested
	// blob chunks, and a channel that might get a single error value.
	// The specified chunks must be not overlapping and sorted by their offset.
	// The readers must be fully consumed, in the order they are returned, before blocking
	// to read the next chunk.
	GetBlobAt(ctx context.Context, info types.BlobInfo, chunks []ImageSourceChunk) (chan io.ReadCloser, chan error, error)
}

BlobChunkAccessor allows fetching discontiguous chunks of a blob.

type ImageDestination

type ImageDestination interface {
	types.ImageDestination
	ImageDestinationInternalOnly
}

ImageDestination is an internal extension to the types.ImageDestination interface.

type ImageDestinationInternalOnly added in v5.22.0

type ImageDestinationInternalOnly interface {
	// SupportsPutBlobPartial returns true if PutBlobPartial is supported.
	SupportsPutBlobPartial() bool

	// PutBlobWithOptions writes contents of stream and returns data representing the result.
	// inputInfo.Digest can be optionally provided if known; if provided, and stream is read to the end without error, the digest MUST match the stream contents.
	// inputInfo.Size is the expected length of stream, if known.
	// inputInfo.MediaType describes the blob format, if known.
	// WARNING: The contents of stream are being verified on the fly.  Until stream.Read() returns io.EOF, the contents of the data SHOULD NOT be available
	// to any other readers for download using the supplied digest.
	// If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlob MUST 1) fail, and 2) delete any data stored so far.
	PutBlobWithOptions(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, options PutBlobOptions) (types.BlobInfo, error)

	// PutBlobPartial attempts to create a blob using the data that is already present
	// at the destination. chunkAccessor is accessed in a non-sequential way to retrieve the missing chunks.
	// It is available only if SupportsPutBlobPartial().
	// Even if SupportsPutBlobPartial() returns true, the call can fail, in which case the caller
	// should fall back to PutBlobWithOptions.
	PutBlobPartial(ctx context.Context, chunkAccessor BlobChunkAccessor, srcInfo types.BlobInfo, cache blobinfocache.BlobInfoCache2) (types.BlobInfo, error)

	// TryReusingBlobWithOptions checks whether the transport already contains, or can efficiently reuse, a blob, and if so, applies it to the current destination
	// (e.g. if the blob is a filesystem layer, this signifies that the changes it describes need to be applied again when composing a filesystem tree).
	// info.Digest must not be empty.
	// If the blob has been successfully reused, returns (true, info, nil); info must contain at least a digest and size, and may
	// include CompressionOperation and CompressionAlgorithm fields to indicate that a change to the compression type should be
	// reflected in the manifest that will be written.
	// If the transport can not reuse the requested blob, TryReusingBlob returns (false, {}, nil); it returns a non-nil error only on an unexpected failure.
	TryReusingBlobWithOptions(ctx context.Context, info types.BlobInfo, options TryReusingBlobOptions) (bool, types.BlobInfo, error)

	// PutSignaturesWithFormat writes a set of signatures to the destination.
	// If instanceDigest is not nil, it contains a digest of the specific manifest instance to write or overwrite the signatures for
	// (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list.
	// MUST be called after PutManifest (signatures may reference manifest contents).
	PutSignaturesWithFormat(ctx context.Context, signatures []signature.Signature, instanceDigest *digest.Digest) error
}

ImageDestinationInternalOnly is the part of private.ImageDestination that is not a part of types.ImageDestination.

type ImageSource

type ImageSource interface {
	types.ImageSource
	ImageSourceInternalOnly
}

ImageSource is an internal extension to the types.ImageSource interface.

type ImageSourceChunk

type ImageSourceChunk struct {
	Offset uint64
	Length uint64
}

ImageSourceChunk is a portion of a blob. This API is experimental and can be changed without bumping the major version number.

type ImageSourceInternalOnly added in v5.22.0

type ImageSourceInternalOnly interface {
	// SupportsGetBlobAt() returns true if GetBlobAt (BlobChunkAccessor) is supported.
	SupportsGetBlobAt() bool
	// BlobChunkAccessor.GetBlobAt is available only if SupportsGetBlobAt().
	BlobChunkAccessor

	// GetSignaturesWithFormat returns the image's signatures.  It may use a remote (= slow) service.
	// If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for
	// (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list
	// (e.g. if the source never returns manifest lists).
	GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error)
}

ImageSourceInternalOnly is the part of private.ImageSource that is not a part of types.ImageSource.

type PutBlobOptions

type PutBlobOptions struct {
	Cache    blobinfocache.BlobInfoCache2 // Cache to optionally update with the uploaded bloblook up blob infos.
	IsConfig bool                         // True if the blob is a config

	EmptyLayer bool // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented.
	LayerIndex *int // If the blob is a layer, a zero-based index of the layer within the image; nil otherwise.
}

PutBlobOptions are used in PutBlobWithOptions.

type TryReusingBlobOptions

type TryReusingBlobOptions struct {
	Cache blobinfocache.BlobInfoCache2 // Cache to use and/or update.
	// If true, it is allowed to use an equivalent of the desired blob;
	// in that case the returned info may not match the input.
	CanSubstitute bool

	EmptyLayer bool            // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented.
	LayerIndex *int            // If the blob is a layer, a zero-based index of the layer within the image; nil otherwise.
	SrcRef     reference.Named // A reference to the source image that contains the input blob.
}

TryReusingBlobOptions are used in TryReusingBlobWithOptions.

type UnparsedImage added in v5.22.0

type UnparsedImage interface {
	types.UnparsedImage
	// UntrustedSignatures is like ImageSource.GetSignaturesWithFormat, but the result is cached; it is OK to call this however often you need.
	UntrustedSignatures(ctx context.Context) ([]signature.Signature, error)
}

UnparsedImage is an internal extension to the types.UnparsedImage interface.

Jump to

Keyboard shortcuts

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