puller

package
v0.7.0-beta5 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package puller implements the logic for pull operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Puller

type Puller struct {
	Client remote.Client
	// contains filtered or unexported fields
}

Puller implements pull operations.

func NewPuller

func NewPuller(client remote.Client, plainHTTP bool, tracker output.Tracker) *Puller

NewPuller create a new puller that can be used for pull operations. The client must be ready to be used by the puller.

func (*Puller) ArtifactConfig added in v0.7.0

func (p *Puller) ArtifactConfig(ctx context.Context, ref, os, arch string) (*oci.ArtifactConfig, error)

ArtifactConfig fetches only the config layer from a given ref. If the artifact has a v1.MediaTypeImageIndex descriptor then it fetches the config layer for the specified platform.

func (*Puller) CheckAllowedType added in v0.4.0

func (p *Puller) CheckAllowedType(ctx context.Context, ref, os, arch string, allowedTypes []oci.ArtifactType) error

CheckAllowedType does a preliminary check on the manifest to state whether we are allowed or not to download this type of artifact. If allowedTypes is empty, everything is allowed, else it is used to perform the check.

func (*Puller) Descriptor

func (p *Puller) Descriptor(ctx context.Context, ref string) (*v1.Descriptor, error)

Descriptor retrieves the descriptor of an artifact from a remote repository.

func (*Puller) Pull

func (p *Puller) Pull(ctx context.Context, ref, destDir, os, arch string) (*oci.RegistryResult, error)

Pull an artifact from a remote registry. Ref format follows: REGISTRY/REPO[:TAG|@DIGEST]. Ex. localhost:5000/hello:latest.

func (*Puller) RawConfigLayer added in v0.7.0

func (p *Puller) RawConfigLayer(ctx context.Context, ref, os, arch string) ([]byte, error)

RawConfigLayer fetches only the config layer from a given ref. If the artifact has a v1.MediaTypeImageIndex descriptor then it fetches the config layer for the specified platform.

func (*Puller) RawManifest added in v0.7.0

func (p *Puller) RawManifest(ctx context.Context, ref, os, arch string) ([]byte, error)

RawManifest fetches the manifest layer from a given reference. If the artifact has a v1.MediaTypeImageIndex descriptor then it fetches the manifest for the specified platform.

Jump to

Keyboard shortcuts

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