jobs

package
v1.7.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Display

func Display(w io.Writer, statuses []StatusInfo, start time.Time)

Display pretty prints out the download or upload progress. From https://github.com/containerd/containerd/blob/v1.7.0-rc.2/cmd/ctr/commands/content/fetch.go#L412-L452

func ShowProgress

func ShowProgress(ctx context.Context, ongoing *Jobs, cs content.Store, out io.Writer)

ShowProgress continuously updates the output with job progress by checking status in the content store.

From https://github.com/containerd/containerd/blob/v1.7.0-rc.2/cmd/ctr/commands/content/fetch.go#L219-L336

Types

type Jobs

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

Jobs provides a way of identifying the download keys for a particular task encountering during the pull walk.

This is very minimal and will probably be replaced with something more featured.

From https://github.com/containerd/containerd/blob/v1.7.0-rc.2/cmd/ctr/commands/content/fetch.go#L338-L349

func New

func New(name string) *Jobs

New creates a new instance of the job status tracker. From https://github.com/containerd/containerd/blob/v1.7.0-rc.2/cmd/ctr/commands/content/fetch.go#L351-L357

func (*Jobs) IsResolved

func (j *Jobs) IsResolved() bool

IsResolved checks whether a descriptor has been resolved. From https://github.com/containerd/containerd/blob/v1.7.0-rc.2/cmd/ctr/commands/content/fetch.go#L381-L386

func (*Jobs) Jobs

func (j *Jobs) Jobs() []ocispec.Descriptor

Jobs returns a list of all tracked descriptors. From https://github.com/containerd/containerd/blob/v1.7.0-rc.2/cmd/ctr/commands/content/fetch.go#L372-L379

type StatusInfo

type StatusInfo struct {
	Ref       string
	Status    StatusInfoStatus
	Offset    int64
	Total     int64
	StartedAt time.Time
	UpdatedAt time.Time
}

StatusInfo holds the status info for an upload or download. From https://github.com/containerd/containerd/blob/v1.7.0-rc.2/cmd/ctr/commands/content/fetch.go#L402-L410

type StatusInfoStatus

type StatusInfoStatus string

StatusInfoStatus describes status info for an upload or download. From https://github.com/containerd/containerd/blob/v1.7.0-rc.2/cmd/ctr/commands/content/fetch.go#L388-L400

const (
	StatusResolved    StatusInfoStatus = "resolved"
	StatusResolving   StatusInfoStatus = "resolving"
	StatusWaiting     StatusInfoStatus = "waiting"
	StatusCommitting  StatusInfoStatus = "committing"
	StatusDone        StatusInfoStatus = "done"
	StatusDownloading StatusInfoStatus = "downloading"
	StatusUploading   StatusInfoStatus = "uploading"
	StatusExists      StatusInfoStatus = "exists"
)

Jump to

Keyboard shortcuts

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