impl

package
v5.30.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CandidateMatchesTryReusingBlobOptions added in v5.30.0

func CandidateMatchesTryReusingBlobOptions(options private.TryReusingBlobOptions, candidateCompression *compression.Algorithm) bool

CandidateMatchesTryReusingBlobOptions validates if compression is required by the caller while selecting a blob, if it is required then function performs a match against the compression requested by the caller and compression of existing blob (which can be nil to represent uncompressed or unknown)

func OriginalCandidateMatchesTryReusingBlobOptions added in v5.30.0

func OriginalCandidateMatchesTryReusingBlobOptions(opts private.TryReusingBlobOptions) bool

Types

type Compat

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

Compat implements the obsolete parts of types.ImageDestination for implementations of private.ImageDestination. See AddCompat below.

func AddCompat

AddCompat initializes Compat to implement the obsolete parts of types.ImageDestination for implementations of private.ImageDestination.

Use it like this:

type yourDestination struct {
	impl.Compat
	…
}

dest := &yourDestination{…}
dest.Compat = impl.AddCompat(dest)

func (*Compat) PutBlob

func (c *Compat) PutBlob(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, cache types.BlobInfoCache, isConfig bool) (types.BlobInfo, error)

PutBlob 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. May update cache. 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.

func (*Compat) PutSignatures

func (c *Compat) PutSignatures(ctx context.Context, signatures [][]byte, instanceDigest *digest.Digest) error

PutSignatures 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).

func (*Compat) TryReusingBlob

func (c *Compat) TryReusingBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache, canSubstitute bool) (bool, types.BlobInfo, error)

TryReusingBlob 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 canSubstitute, TryReusingBlob can use an equivalent equivalent of the desired blob; in that case the returned info may not match the input. 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. May use and/or update cache.

type Properties

type Properties struct {
	// SupportedManifestMIMETypes tells which manifest MIME types the destination supports.
	// A empty slice or nil means any MIME type can be tried to upload.
	SupportedManifestMIMETypes []string
	// DesiredLayerCompression indicates the kind of compression to apply on layers
	DesiredLayerCompression types.LayerCompression
	// AcceptsForeignLayerURLs is false if foreign layers in manifest should be actually
	// uploaded to the image destination, true otherwise.
	AcceptsForeignLayerURLs bool
	// MustMatchRuntimeOS is set to true if the destination can store only images targeted for the current runtime architecture and OS.
	MustMatchRuntimeOS bool
	// IgnoresEmbeddedDockerReference is set to true if the destination does not care about Image.EmbeddedDockerReferenceConflicts(),
	// and would prefer to receive an unmodified manifest instead of one modified for the destination.
	// Does not make a difference if Reference().DockerReference() is nil.
	IgnoresEmbeddedDockerReference bool
	// HasThreadSafePutBlob indicates that PutBlob can be executed concurrently.
	HasThreadSafePutBlob bool
}

Properties collects properties of an ImageDestination that are constant throughout its lifetime (but might differ across instances).

type PropertyMethodsInitialize

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

PropertyMethodsInitialize implements parts of private.ImageDestination corresponding to Properties.

func PropertyMethods

func PropertyMethods(vals Properties) PropertyMethodsInitialize

PropertyMethods creates an PropertyMethodsInitialize for vals.

func (PropertyMethodsInitialize) AcceptsForeignLayerURLs

func (o PropertyMethodsInitialize) AcceptsForeignLayerURLs() bool

AcceptsForeignLayerURLs returns false iff foreign layers in manifest should be actually uploaded to the image destination, true otherwise.

func (PropertyMethodsInitialize) DesiredLayerCompression

func (o PropertyMethodsInitialize) DesiredLayerCompression() types.LayerCompression

DesiredLayerCompression indicates the kind of compression to apply on layers

func (PropertyMethodsInitialize) HasThreadSafePutBlob

func (o PropertyMethodsInitialize) HasThreadSafePutBlob() bool

HasThreadSafePutBlob indicates whether PutBlob can be executed concurrently.

func (PropertyMethodsInitialize) IgnoresEmbeddedDockerReference

func (o PropertyMethodsInitialize) IgnoresEmbeddedDockerReference() bool

IgnoresEmbeddedDockerReference() returns true iff the destination does not care about Image.EmbeddedDockerReferenceConflicts(), and would prefer to receive an unmodified manifest instead of one modified for the destination. Does not make a difference if Reference().DockerReference() is nil.

func (PropertyMethodsInitialize) MustMatchRuntimeOS

func (o PropertyMethodsInitialize) MustMatchRuntimeOS() bool

MustMatchRuntimeOS returns true iff the destination can store only images targeted for the current runtime architecture and OS. False otherwise.

func (PropertyMethodsInitialize) SupportedManifestMIMETypes

func (o PropertyMethodsInitialize) SupportedManifestMIMETypes() []string

SupportedManifestMIMETypes tells which manifest mime types the destination supports If an empty slice or nil it's returned, then any mime type can be tried to upload

Jump to

Keyboard shortcuts

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