Documentation ¶
Index ¶
- type Destination
- func (d *Destination) Directory() string
- func (d *Destination) Exists() bool
- func (d *Destination) HaveDigest(dig digest.Digest) bool
- func (d *Destination) ImageBySet(set types.FilterSet, copyProvenance bool) *archive.Image
- func (d *Destination) Init(ctx context.Context) error
- func (d *Destination) InspectRAW(ctx context.Context) ([]byte, string, error)
- func (d *Destination) MIME() string
- func (d *Destination) ManifestImages() manifest.Images
- func (d *Destination) MultiArchTag(os, osVersion, arch, variant string) string
- func (d *Destination) Reference() (typesv5.ImageReference, error)
- func (d *Destination) ReferenceMultiArch(os, osVersion, arch, variant, sha256sum string) (typesv5.ImageReference, error)
- func (d *Destination) ReferenceName() string
- func (d *Destination) ReferenceNameDigest(dig digest.Digest) string
- func (d *Destination) ReferenceNameMultiArch(os, osVersion, arch, variant, sha256sum string) string
- func (d *Destination) ReferenceNameWithoutTransport() string
- func (d *Destination) SystemContext() *typesv5.SystemContext
- func (d *Destination) Type() types.ImageType
- type Option
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(dig digest.Digest) bool
func (*Destination) ImageBySet ¶
func (*Destination) InspectRAW ¶
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() (typesv5.ImageReference, error)
func (*Destination) ReferenceMultiArch ¶
func (d *Destination) ReferenceMultiArch( os, osVersion, arch, variant, sha256sum string, ) (typesv5.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() *typesv5.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 *typesv5.SystemContext }
Option is used for create the Destination object.
Click to show internal directories.
Click to hide internal directories.