layer

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 41 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestSuiteLayer added in v0.11.0

func TestSuiteLayer(t *testing.T, store metadata.Store)

Types

type Info

type Info struct {
	Digest       digest.Digest
	Size         int64     // layer size in bytes
	FetchedSize  int64     // layer fetched size in bytes
	PrefetchSize int64     // layer prefetch size in bytes
	ReadTime     time.Time // last time the layer was read
}

Info is the current status of a layer.

type Layer

type Layer interface {
	// Info returns the information of this layer.
	Info() Info

	// RootNode returns the root node of this layer.
	RootNode(baseInode uint32) (fusefs.InodeEmbedder, error)

	// Check checks if the layer is still connectable.
	Check() error

	// Refresh refreshes the layer connection.
	Refresh(ctx context.Context, hosts source.RegistryHosts, refspec reference.Spec, desc ocispec.Descriptor) error

	// Verify verifies this layer using the passed TOC Digest.
	// Nop if Verify() or SkipVerify() was already called.
	Verify(tocDigest digest.Digest) (err error)

	// SkipVerify skips verification for this layer.
	// Nop if Verify() or SkipVerify() was already called.
	SkipVerify()

	// Prefetch prefetches the specified size. If the layer is eStargz and contains landmark files,
	// the range indicated by these files is respected.
	Prefetch(prefetchSize int64) error

	// ReadAt reads this layer.
	ReadAt([]byte, int64, ...remote.Option) (int, error)

	// WaitForPrefetchCompletion waits untils Prefetch completes.
	WaitForPrefetchCompletion() error

	// BackgroundFetch fetches the entire layer contents to the cache.
	// Fetching contents is done as a background task.
	BackgroundFetch() error

	// Done releases the reference to this layer. The resources related to this layer will be
	// discarded sooner or later. Queries after calling this function won't be serviced.
	Done()
}

Layer represents a layer.

type OverlayOpaqueType added in v0.11.3

type OverlayOpaqueType int
const (
	OverlayOpaqueAll OverlayOpaqueType = iota
	OverlayOpaqueTrusted
	OverlayOpaqueUser
)

type Resolver

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

Resolver resolves the layer location and provieds the handler of that layer.

func NewResolver

func NewResolver(root string, backgroundTaskManager *task.BackgroundTaskManager, cfg config.Config, resolveHandlers map[string]remote.Handler, metadataStore metadata.Store, overlayOpaqueType OverlayOpaqueType, additionalDecompressors func(context.Context, source.RegistryHosts, reference.Spec, ocispec.Descriptor) []metadata.Decompressor) (*Resolver, error)

NewResolver returns a new layer resolver.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, hosts source.RegistryHosts, refspec reference.Spec, desc ocispec.Descriptor, esgzOpts ...metadata.Option) (_ Layer, retErr error)

Resolve resolves a layer based on the passed layer blob information.

Jump to

Keyboard shortcuts

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