destination

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

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

Destination represents the destination of the image to be copied。 The type of the destination image can be: docker, docker-daemon, oci or dir (docker-archive won't be supported by hangar)

func NewDestination

func NewDestination(o *Option) (*Destination, error)

NewDestination is the constructor to create a Destination object.

func (*Destination) Directory

func (d *Destination) Directory() string

func (*Destination) Exists

func (d *Destination) Exists() bool

Exists checks the destination image is exists or not.

func (*Destination) HaveDigest

func (d *Destination) HaveDigest(imageDigest digest.Digest) bool

func (*Destination) ImageBySet

func (d *Destination) ImageBySet(set map[string]map[string]bool) *archive.Image

func (*Destination) Init

func (d *Destination) Init(ctx context.Context) error

func (*Destination) InspectRAW

func (d *Destination) InspectRAW(ctx context.Context) ([]byte, string, error)

func (*Destination) MIME

func (d *Destination) MIME() string

func (*Destination) ManifestImages

func (d *Destination) ManifestImages() manifest.Images

func (*Destination) MultiArchTag

func (d *Destination) MultiArchTag(os, osVersion, arch, variant string) string

func (*Destination) Reference

func (d *Destination) Reference() (imagetypes.ImageReference, error)

func (*Destination) ReferenceMultiArch

func (d *Destination) ReferenceMultiArch(
	os, osVersion, arch, variant, sha256sum string,
) (imagetypes.ImageReference, error)

func (*Destination) ReferenceName

func (d *Destination) ReferenceName() string

ReferenceName returns the reference name 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 (*Destination) ReferenceNameDigest

func (d *Destination) ReferenceNameDigest(dig digest.Digest) string

func (*Destination) ReferenceNameMultiArch

func (d *Destination) ReferenceNameMultiArch(
	os, osVersion, arch, variant, sha256sum string,
) string

ReferenceName returns the multi-arch (os, variant) reference name with transport of the source image.

Example:
	docker://docker.io/library/hello-world:latest-linux-amd64
	docker://docker.io/library/example:latest-windows-10.0.14393.1066-amd64
	docker-daemon://docker.io/library/nginx:1.23-linux-arm64
	oci:./path/to/oci-image/<sha256sum>
	dir:./path/to/image/<sha256sum>

func (*Destination) ReferenceNameWithoutTransport

func (d *Destination) ReferenceNameWithoutTransport() string

func (*Destination) SystemContext

func (d *Destination) SystemContext() *imagetypes.SystemContext

func (*Destination) Type

func (d *Destination) Type() types.ImageType

Type returns the type of the image

type Option

type Option struct {
	// Image Type.
	Type types.ImageType
	// Directory, need to provide if Type is dir / oci
	Directory string
	// Registry, need to provide if Type is docker / docker-daemon
	Registry string
	// Project (also called namespace on some public cloud providers),
	// need to provide if Type is docker / docker-daemon
	Project string
	// Image Name, need to provide if Type is docker / docker-daemon
	Name string
	// Image Tag, need to provide if Type is docker / docker-daemon
	Tag string

	SystemContext *imagetypes.SystemContext
}

Option is used for create the Destination object.

Jump to

Keyboard shortcuts

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