registry

package
v0.9.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ArtifactTypeNotation = "application/vnd.cncf.notary.v2.signature"

ArtifactTypeNotation specifies the artifact type for a notation object.

View Source
const MediaTypeNotationSignature = "application/jose+json"

MediaTypeNotationSignature specifies the media type for the notation signature.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepositoryClient

type RepositoryClient struct {
	remote.Repository
}

func NewRepositoryClient

func NewRepositoryClient(client remote.Client, ref registry.Reference, plainHTTP bool) *RepositoryClient

NewRepositoryClient creates a new registry client.

func (*RepositoryClient) Get

func (c *RepositoryClient) Get(ctx context.Context, signatureDigest digest.Digest) ([]byte, error)

Get downloads the signature by the specified digest

func (*RepositoryClient) GetManifestDescriptor

func (c *RepositoryClient) GetManifestDescriptor(ctx context.Context, ref string) (notation.Descriptor, error)

GetManifestDescriptor returns signature manifest information by tag or digest.

func (c *RepositoryClient) Link(ctx context.Context, manifest, signature notation.Descriptor) (notation.Descriptor, error)

Link creates an signature artifact linking the manifest and the signature

func (*RepositoryClient) Lookup

func (c *RepositoryClient) Lookup(ctx context.Context, manifestDigest digest.Digest) ([]digest.Digest, error)

Lookup finds all signatures for the specified manifest

func (*RepositoryClient) Put

func (c *RepositoryClient) Put(ctx context.Context, signature []byte) (notation.Descriptor, error)

Put uploads the signature to the registry

type SignatureRepository

type SignatureRepository interface {
	// Lookup finds all signatures for the specified manifest
	Lookup(ctx context.Context, manifestDigest digest.Digest) ([]digest.Digest, error)

	// Get downloads the signature by the specified digest
	Get(ctx context.Context, signatureDigest digest.Digest) ([]byte, error)

	// Put uploads the signature to the registry
	Put(ctx context.Context, signature []byte) (notation.Descriptor, error)

	// Link creates an signature artifact linking the manifest and the signature
	Link(ctx context.Context, manifest, signature notation.Descriptor) (notation.Descriptor, error)
}

SignatureRepository provides a storage for signatures

Jump to

Keyboard shortcuts

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