package content

import "github.com/containerd/containerd/cmd/ctr/commands/content"

Index

Variables

var (
	// Command is the cli command for managing content
	Command = cli.Command{
		Name:  "content",
		Usage: "manage content",
		Subcommands: cli.Commands{
			activeIngestCommand,
			deleteCommand,
			editCommand,
			fetchCommand,
			fetchObjectCommand,
			getCommand,
			ingestCommand,
			listCommand,
			pushObjectCommand,
			setLabelsCommand,
			pruneCommand,
		},
	}
)

Functions

func Display

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

Display pretty prints out the download or upload progress

func Fetch

func Fetch(ctx context.Context, client *containerd.Client, ref string, config *FetchConfig) (images.Image, error)

Fetch loads all resources into the content store and returns the image

func ShowProgress

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

Types

type FetchConfig

type FetchConfig struct {
	// Resolver
	Resolver remotes.Resolver
	// ProgressOutput to display progress
	ProgressOutput io.Writer
	// Labels to set on the content
	Labels []string
	// PlatformMatcher matches platforms, supersedes Platforms
	PlatformMatcher platforms.MatchComparer
	// Platforms to fetch
	Platforms []string
	// Whether or not download all metadata
	AllMetadata bool
	// RemoteOpts is not used by ctr, but can be used by other CLI tools
	RemoteOpts []containerd.RemoteOpt
}

FetchConfig for content fetch

func NewFetchConfig

func NewFetchConfig(ctx context.Context, clicontext *cli.Context) (*FetchConfig, error)

NewFetchConfig returns the default FetchConfig from cli flags

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.

func NewJobs

func NewJobs(name string) *Jobs

func (*Jobs) Add

func (j *Jobs) Add(desc ocispec.Descriptor)

func (*Jobs) IsResolved

func (j *Jobs) IsResolved() bool

func (*Jobs) Jobs

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

type StatusInfo

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

StatusInfo holds the status info for an upload or download

Source Files

content.go fetch.go prune.go

Version
v1.5.0-beta.1
Published
Feb 5, 2021
Platform
windows/amd64
Imports
27 packages
Last checked
5 minutes ago

Tools for package owners.