zoci

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package zoci contains functions for interacting with Jackal packages stored in OCI registries.

Package zoci contains functions for interacting with Jackal packages stored in OCI registries.

Package zoci contains functions for interacting with Jackal packages stored in OCI registries.

Package zoci contains functions for interacting with Jackal packages stored in OCI registries.

Package zoci contains functions for interacting with Jackal packages stored in OCI registries.

Package zoci contains functions for interacting with Jackal packages stored in OCI registries.

Index

Constants

View Source
const (
	// JackalConfigMediaType is the media type for the manifest config
	JackalConfigMediaType = "application/vnd.jackal.config.v1+json"
	// JackalLayerMediaTypeBlob is the media type for all Jackal layers due to the range of possible content
	JackalLayerMediaTypeBlob = "application/vnd.jackal.layer.v1.blob"
	// SkeletonArch is the architecture used for skeleton packages
	SkeletonArch = "skeleton"
)

Variables

View Source
var (
	// PackageAlwaysPull is a list of paths that will always be pulled from the remote repository.
	PackageAlwaysPull = []string{layout.JackalYAML, layout.Checksums, layout.Signature}
)

Functions

func CopyPackage

func CopyPackage(ctx context.Context, src *Remote, dst *Remote, concurrency int) error

CopyPackage copies a jackal package from one OCI registry to another

func GetInitPackageURL

func GetInitPackageURL(version string) string

GetInitPackageURL returns the URL for the init package for the given version.

func PlatformForSkeleton

func PlatformForSkeleton() ocispec.Platform

PlatformForSkeleton sets the target architecture for the remote to skeleton

func ReferenceFromMetadata

func ReferenceFromMetadata(registryLocation string, metadata *types.JackalMetadata, build *types.JackalBuildData) (string, error)

ReferenceFromMetadata returns a reference for the given metadata.

Types

type Remote

type Remote struct {
	*oci.OrasRemote
}

Remote is a wrapper around the Oras remote repository with jackal specific functions

func NewRemote

func NewRemote(url string, platform ocispec.Platform, mods ...oci.Modifier) (*Remote, error)

NewRemote returns an oras remote repository client and context for the given url with jackal opination embedded

func (*Remote) FetchImagesIndex

func (r *Remote) FetchImagesIndex(ctx context.Context) (index *ocispec.Index, err error)

FetchImagesIndex fetches the images/index.json file from the remote repository.

func (*Remote) FetchJackalYAML

func (r *Remote) FetchJackalYAML(ctx context.Context) (pkg types.JackalPackage, err error)

FetchJackalYAML fetches the jackal.yaml file from the remote repository.

func (*Remote) LayersFromRequestedComponents

func (r *Remote) LayersFromRequestedComponents(ctx context.Context, requestedComponents []types.JackalComponent) (layers []ocispec.Descriptor, err error)

LayersFromRequestedComponents returns the descriptors for the given components from the root manifest.

It also retrieves the descriptors for all image layers that are required by the components.

func (*Remote) PublishPackage

func (r *Remote) PublishPackage(ctx context.Context, pkg *types.JackalPackage, paths *layout.PackagePaths, concurrency int) error

PublishPackage publishes the jackal package to the remote repository.

func (*Remote) PullPackage

func (r *Remote) PullPackage(ctx context.Context, destinationDir string, concurrency int, layersToPull ...ocispec.Descriptor) ([]ocispec.Descriptor, error)

PullPackage pulls the package from the remote repository and saves it to the given path.

layersToPull is an optional parameter that allows the caller to specify which layers to pull.

The following layers will ALWAYS be pulled if they exist:

  • jackal.yaml
  • checksums.txt
  • jackal.yaml.sig

func (*Remote) PullPackageMetadata

func (r *Remote) PullPackageMetadata(ctx context.Context, destinationDir string) ([]ocispec.Descriptor, error)

PullPackageMetadata pulls the package metadata from the remote repository and saves it to `destinationDir`.

func (*Remote) PullPackageSBOM

func (r *Remote) PullPackageSBOM(ctx context.Context, destinationDir string) ([]ocispec.Descriptor, error)

PullPackageSBOM pulls the package's sboms.tar from the remote repository and saves it to `destinationDir`.

Jump to

Keyboard shortcuts

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