source

package
v1.7.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	// Image Type.
	Type types.ImageType
	// Directory, need to provide if Type is dir / oci / docker-archive
	Directory string
	// Registry, need to provide if Type is docker, docker-daemon, docker-archive
	Registry string
	// Project (also called namespace on some public cloud providers),
	// need to provide if Type is docker / docker-daemon / docker-archive
	Project string
	// Image name, need to provide if Type is docker / docker-daemon / docker-archive
	Name string
	// Image tag, need to provide if Type is docker / docker-daemon / docker-archive
	Tag string
	// Digest is used to identify the Digest of the image to be copied,
	// only available when Type is docker.
	Digest digest.Digest

	SystemContext *imagetypes.SystemContext
}

Option is used for create the Source object.

type Source

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

Source represents the source image to be copied. The type of the source image can be: docker, docker-daemon, docker-archive, oci or dir

func NewSource

func NewSource(o *Option) (*Source, error)

NewSource is the constructor to create a Source object. Need to call Init method after creating the Source object before use.

func (*Source) Copy

func (s *Source) Copy(
	ctx context.Context,
	dest *destination.Destination,
	sets map[string]map[string]bool,
	policy *signature.Policy,
) error

func (*Source) Directory

func (s *Source) Directory() string

func (*Source) GetCopiedImage

func (s *Source) GetCopiedImage() *archive.Image

func (*Source) ImageBySet

func (s *Source) ImageBySet(set map[string]map[string]bool) *archive.Image

func (*Source) Init

func (s *Source) Init(ctx context.Context) error

Init initialize the source image manifest.

func (*Source) InspectRAW

func (s *Source) InspectRAW(ctx context.Context) ([]byte, string, error)

func (*Source) MIME

func (s *Source) MIME() string

func (*Source) Name

func (s *Source) Name() string

func (*Source) Project

func (s *Source) Project() string

func (*Source) Reference

func (s *Source) Reference() (imagetypes.ImageReference, error)

func (*Source) ReferenceName

func (s *Source) ReferenceName() string

ReferenceName returns the reference with transport of the source image.

Example:
	docker://docker.io/library/hello-world:latest
	docker-daemon://docker.io/library/nginx:1.23
	oci:./path/to/oci-image

func (*Source) ReferenceNameWithoutTransport

func (s *Source) ReferenceNameWithoutTransport() string

func (*Source) ReferenceNameWithoutTransportAndTag

func (s *Source) ReferenceNameWithoutTransportAndTag() string

func (*Source) Registry

func (s *Source) Registry() string

func (*Source) SystemContext

func (s *Source) SystemContext() *imagetypes.SystemContext

func (*Source) Tag

func (s *Source) Tag() string

func (*Source) Type

func (s *Source) Type() types.ImageType

Type returns the type of the image

Jump to

Keyboard shortcuts

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