registry

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MediaTypeDockerManifestList = "application/vnd.docker.distribution.manifest.list.v2+json"
	MediaTypeDockerManifest     = "application/vnd.docker.distribution.manifest.v2+json"
	MediaTypeOCIManifest        = "application/vnd.oci.image.manifest.v1+json"
	MediaTypeOCIIndexManifest   = "application/vnd.oci.image.index.v1+json"

	MediaTypeDockerImageConfig = "application/vnd.docker.container.image.v1+json"
	MediaTypeOCIImageConfig    = "application/vnd.oci.image.config.v1+json"
)

Variables

List of config's media type for images

View Source
var RegistryNotSupportingOciArtifacts = errors.New("Registry does not support OCI artifacts")

Functions

This section is empty.

Types

type Manifest added in v1.0.2

type Manifest struct {
	ocispec.Manifest

	Manifests []ocispec.Descriptor `json:"manifests"`
}

type Registry

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

func Init

func Init(ctx context.Context, registryUrl string, authToken string) (*Registry, error)

Initialize a remote registry

func (*Registry) GetImageDigests added in v1.0.2

func (registry *Registry) GetImageDigests(ctx context.Context, repositoryName string, digest string) (digests []string, err error)

GetImageDigests inspects an image reference and returns all valid digets that need to be indexed. For multi-arch images (docker manifest), that includes all digests mentioned by the manifest. For normal images, it's just the image digest itself.

func (*Registry) GetManifest

func (registry *Registry) GetManifest(ctx context.Context, repositoryName string, digest string) (Manifest, error)

Call registry's getManifest and return the image's manifest The image reference must be a digest because that's what oras-go FetchReference takes

func (*Registry) HeadManifest

func (registry *Registry) HeadManifest(ctx context.Context, repositoryName string, reference string) (ocispec.Descriptor, error)

Call registry's headManifest and return the manifest's descriptor

func (*Registry) Pull

func (registry *Registry) Pull(ctx context.Context, repositoryName string, sociStore *store.SociStore, imageReference string) (*ocispec.Descriptor, error)

Pull an image from the remote registry to a local OCI Store imageReference can be either a digest or a tag

func (*Registry) Push

func (registry *Registry) Push(ctx context.Context, sociStore *store.SociStore, indexDesc ocispec.Descriptor, repositoryName string) error

Push a OCI artifact to remote registry descriptor: ocispec Descriptor of the artifact ociStore: the local OCI store

func (*Registry) ValidateImageManifest

func (registry *Registry) ValidateImageManifest(ctx context.Context, repositoryName string, digest string) error

Validate if a digest is a valid image manifest

Jump to

Keyboard shortcuts

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