converter

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MediaTypeDockerSchema2Manifest     = "application/vnd.docker.distribution.manifest.v2+json"
	MediaTypeDockerSchema2ManifestList = "application/vnd.docker.distribution.manifest.list.v2+json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConvertOpt added in v0.2.0

type ConvertOpt func(opts *ConvertOpts) error

func WithDriver added in v0.2.0

func WithDriver(typ string, config map[string]string) ConvertOpt

func WithPlatform added in v0.2.0

func WithPlatform(platformMC platforms.MatchComparer) ConvertOpt

func WithProvider added in v0.2.0

func WithProvider(provider content.Provider) ConvertOpt

type ConvertOpts added in v0.2.0

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

type Converter

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

func New added in v0.2.0

func New(opts ...ConvertOpt) (*Converter, error)

func (*Converter) Convert added in v0.2.0

func (cvt *Converter) Convert(ctx context.Context, source, target string) (*Metric, error)

type Metric added in v0.2.3

type Metric struct {
	// Total size of the source image with specified platforms in bytes
	SourceImageSize int64
	// Total size of the target image with specified platforms in bytes
	TargetImageSize int64
	// Elapsed time of pulling source image
	SourcePullElapsed time.Duration
	// Elapsed time of pushing target image
	ConversionElapsed time.Duration
	// Elapsed time of converting source image to target image
	TargetPushElapsed time.Duration
}

Metric collected the metrics of conversion progress

func (*Metric) SetSourceImageSize added in v0.2.3

func (metric *Metric) SetSourceImageSize(ctx context.Context, cvt *Converter, source string) error

func (*Metric) SetTargetImageSize added in v0.2.3

func (metric *Metric) SetTargetImageSize(ctx context.Context, cs content.Store, desc *ocispec.Descriptor) error

Jump to

Keyboard shortcuts

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