source

package
v1.9.0-beta.8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CopyOptions

type CopyOptions struct {
	SigstorePrivateKey string
	SigstorePassphrase []byte
	RemoveSignatures   bool
	CopyProvenance     bool
	Annotations        map[string]string

	Destination *destination.Destination
	Set         types.FilterSet
	Policy      *signaturev5.Policy
}

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 *typesv5.SystemContext
}

Option is used for create the Source object.

type ScanOptions

type ScanOptions struct {
	Set types.FilterSet
}

type SignV1Options added in v1.9.0

type SignV1Options struct {
	SigstorePrivateKey string
	SigstorePassphrase []byte
	Set                types.FilterSet
	Policy             *signaturev5.Policy
}

type SignV2Options added in v1.9.0

type SignV2Options struct {
	signv2.SignerOption

	// Sign DockerV2ListMediaType and oci MediaTypeImageIndex
	SignManifestIndex bool

	Set types.FilterSet
}

type Source

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

Source represents the source image to be copied or sign. 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,
	opts *CopyOptions,
) 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 types.FilterSet, copyProvenance 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) IsSigstoreSignature

func (s *Source) IsSigstoreSignature() bool

IsSigstoreSignature detects whether the source image is a sigstore signature

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() (typesv5.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) Scan

func (s *Source) Scan(
	ctx context.Context,
	opts *ScanOptions,
) (*scan.Result, error)

func (*Source) SignV1 added in v1.9.0

func (s *Source) SignV1(
	ctx context.Context,
	opts *SignV1Options,
) error

func (*Source) SignV2 added in v1.9.0

func (s *Source) SignV2(
	ctx context.Context,
	opts *SignV2Options,
) error

func (*Source) SystemContext

func (s *Source) SystemContext() *typesv5.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

func (*Source) ValidateSignatureV1 added in v1.9.0

func (s *Source) ValidateSignatureV1(
	ctx context.Context,
	publicKey string,
	repository string,
	set types.FilterSet,
) error

func (*Source) ValidateSignatureV2 added in v1.9.0

func (s *Source) ValidateSignatureV2(
	ctx context.Context,
	opts *ValidateV2Options,
) ([]*signv2.ImageResult, error)

type ValidateV2Options added in v1.9.0

type ValidateV2Options struct {
	signv2.ValidatorOption

	ValidateManifestIndex bool

	Set types.FilterSet
}

Jump to

Keyboard shortcuts

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