unpack

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyedLocker added in v2.2.0

type KeyedLocker interface {
	Lock(ctx context.Context, key string) error
	Unlock(key string)
}

KeyedLocker is an interface for managing job duplication by locking on a given key.

type Limiter added in v2.2.0

type Limiter interface {
	Acquire(context.Context, int64) error
	Release(int64)
}

Limiter interface is used to restrict the number of concurrent operations by requiring operations to first acquire from the limiter and release when complete.

type Platform

type Platform struct {
	Platform platforms.Matcher

	SnapshotterKey          string
	Snapshotter             snapshots.Snapshotter
	SnapshotOpts            []snapshots.Opt
	SnapshotterExports      map[string]string
	SnapshotterCapabilities []string

	Applier   diff.Applier
	ApplyOpts []diff.ApplyOpt

	// ConfigType is the supported config type to be considered for unpacking
	// Defaults to OCI image config
	ConfigType string

	// LayerTypes are the supported types to be considered layers
	// Defaults to OCI image layers
	LayerTypes []string
}

Platform represents a platform-specific unpack configuration which includes the platform matcher as well as snapshotter and applier.

type Result

type Result struct {
	Unpacks int
}

Result returns information about the unpacks which were completed.

type Unpacker

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

Unpacker unpacks images by hooking into the image handler process. Unpacks happen in the backgrounds and waited on to complete.

func NewUnpacker

func NewUnpacker(ctx context.Context, cs content.Store, opts ...UnpackerOpt) (*Unpacker, error)

NewUnpacker creates a new instance of the unpacker which can be used to wrap an image handler and unpack in parallel to handling. The unpacker will handle calling the block handlers when they are needed by the unpack process.

func (*Unpacker) Unpack

func (u *Unpacker) Unpack(h images.Handler) images.Handler

Unpack wraps an image handler to filter out blob handling and scheduling them during the unpack process. When an image config is encountered, the unpack process will be started in a goroutine.

func (*Unpacker) Wait

func (u *Unpacker) Wait() (Result, error)

Wait waits for any ongoing unpack processes to complete then will return the result.

type UnpackerOpt

type UnpackerOpt func(*unpackerConfig) error

func WithDuplicationSuppressor

func WithDuplicationSuppressor(d KeyedLocker) UnpackerOpt

func WithLimiter

func WithLimiter(l Limiter) UnpackerOpt

func WithUnpackLimiter added in v2.2.0

func WithUnpackLimiter(l Limiter) UnpackerOpt

func WithUnpackPlatform

func WithUnpackPlatform(u Platform) UnpackerOpt

Jump to

Keyboard shortcuts

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