converter

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

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 WithAnnotation added in v0.2.5

func WithAnnotation(annotations map[string]string) ConvertOpt

WithAnnotation appends extra annotations for each target image manifest.

func WithDriver added in v0.2.0

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

WithDriver specifies the conversion driver type and config.

func WithPlatform added in v0.2.0

func WithPlatform(platformMC platforms.MatchComparer) ConvertOpt

WithPlatform specifies the platforms only to convert.

func WithProvider added in v0.2.0

func WithProvider(provider content.Provider) ConvertOpt

WithDriver specifies the image store provider.

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, cacheRef 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, cvt *Converter, desc *ocispec.Descriptor) error

Jump to

Keyboard shortcuts

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