oci

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrArtifactNotFound indicates that the requested artifact was not found
	// in the registry.
	ErrArtifactNotFound = errors.New("artifact not found")

	// ErrLayerNotFound indicates that the requested layer was not found in the
	// OCI artifact provided.
	ErrLayerNotFound = errors.New("layer not found")
)

Functions

This section is empty.

Types

type Puller

type Puller struct{}

Puller is a hub.OCIPuller implementation.

func (*Puller) PullLayer

func (p *Puller) PullLayer(
	ctx context.Context,
	ref,
	mediaType,
	username,
	password string,
) (ocispec.Descriptor, []byte, error)

PullLayer pulls the first layer of the media type provided from the OCI artifact at the given reference.

type PullerMock

type PullerMock struct {
	mock.Mock
}

PullerMock is a mock hub.OCIPuller implementation.

func (*PullerMock) PullLayer

func (m *PullerMock) PullLayer(
	ctx context.Context,
	ref,
	mediaType,
	username,
	password string,
) (ocispec.Descriptor, []byte, error)

PullLayer implements the hub.OCIPuller interface.

type SignatureChecker added in v1.5.0

type SignatureChecker struct{}

SignatureChecker is a hub.OCISignatureChecker implementation.

func (*SignatureChecker) HasCosignSignature added in v1.5.0

func (c *SignatureChecker) HasCosignSignature(
	ctx context.Context,
	ref,
	username,
	password string,
) (bool, error)

HasCosignSignature checks if the OCI artifact identified by the reference provided has a cosign (sigstore) signature.

type SignatureCheckerMock added in v1.5.0

type SignatureCheckerMock struct {
	mock.Mock
}

SignatureCheckerMock is a mock implementation of the hub.OCISignatureChecker interface.

func (*SignatureCheckerMock) HasCosignSignature added in v1.5.0

func (m *SignatureCheckerMock) HasCosignSignature(
	ctx context.Context,
	ref,
	username,
	password string,
) (bool, error)

HasCosignSignature implements the OCITagsGetter interface.

type TagsGetter added in v1.5.0

type TagsGetter struct{}

OCITagsGetter provides a mechanism to get all the version tags available for a given repository in a OCI registry. Tags that aren't valid semver versions will be filtered out.

func (*TagsGetter) Tags added in v1.5.0

func (tg *TagsGetter) Tags(ctx context.Context, r *hub.Repository, onlySemver bool) ([]string, error)

Tags returns a list with the tags available for the provided repository.

type TagsGetterMock added in v1.5.0

type TagsGetterMock struct {
	mock.Mock
}

TagsGetterMock is a mock implementation of the hub.OCITagsGetter interface.

func (*TagsGetterMock) Tags added in v1.5.0

func (m *TagsGetterMock) Tags(ctx context.Context, r *hub.Repository, onlySemver bool) ([]string, error)

Tags implements the OCITagsGetter interface.

Jump to

Keyboard shortcuts

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