progress

package
v1.13.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package progress provides functionality to track and report image pull progress.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LayerPullProgress

type LayerPullProgress struct {
	LayerID string
	Status  LayerPullStatus
	// If Status is Extracting, this shows the elapsed time since extraction started.
	Elapsed time.Duration
	// If Status is Downloading, these show the current offset and total size of the layer.
	Offset int64
	Total  int64
}

LayerPullProgress represents the progress of an image pull operation.

Note: keep this in sync machine/images.proto.

type LayerPullStatus

type LayerPullStatus int

LayerPullStatus represents the status of a single image layer during pull.

const (
	LayerPullStatusDownloading LayerPullStatus = iota
	LayerPullStatusDownloadComplete
	LayerPullStatusExtracting
	LayerPullStatusExtractComplete
	LayerPullStatusAlreadyExists
)

Possible values for LayerPullStatus.

type PullProgress

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

PullProgress tracks and reports the progress of image pulls.

func NewPullProgress

func NewPullProgress(store content.Store, snapshotter snapshots.Snapshotter, fn UpdateFn) *PullProgress

NewPullProgress creates a new PullProgress instance.

func (*PullProgress) Add

func (p *PullProgress) Add(desc ...ocispec.Descriptor)

Add adds new descriptors to be tracked.

func (*PullProgress) ShowProgress

func (p *PullProgress) ShowProgress(ctx context.Context) func()

ShowProgress starts tracking and reporting pull progress.

type UpdateFn

type UpdateFn func(LayerPullProgress)

UpdateFn is used by PullProgress to report progress updates.

Jump to

Keyboard shortcuts

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