content

package
v1.7.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 28 Imported by: 223

Documentation

Index

Constants

This section is empty.

Variables

View Source
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,
			fetchBlobCommand,
			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 added in v1.5.0

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.

Types

type FetchConfig added in v1.2.0

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 to configure object resolutions and transfers with remote content providers
	RemoteOpts []containerd.RemoteOpt
	// TraceHTTP writes DNS and connection information to the log when dealing with a container registry
	TraceHTTP bool
}

FetchConfig for content fetch

func NewFetchConfig added in v1.2.0

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

NewFetchConfig returns the default FetchConfig from cli flags

type Jobs added in v1.5.0

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 added in v1.5.0

func NewJobs(name string) *Jobs

NewJobs creates a new instance of the job status tracker

func (*Jobs) Add added in v1.5.0

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

Add adds a descriptor to be tracked

func (*Jobs) IsResolved added in v1.5.0

func (j *Jobs) IsResolved() bool

IsResolved checks whether a descriptor has been resolved

func (*Jobs) Jobs added in v1.5.0

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

Jobs returns a list of all tracked descriptors

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

type StatusInfoStatus added in v1.7.0

type StatusInfoStatus string

StatusInfoStatus describes status info for an upload or download.

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