plainimage

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotAnImageError

func IsNotAnImageError(err error) bool

Types

type Contents

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

Contents of the OCI Image

func NewContents

func NewContents(paths []string, excludedPaths []string, preservePermissions bool) Contents

NewContents creates the struct that represent an OCI Image based on the provided paths

func (Contents) Push

func (i Contents) Push(uploadRef regname.Tag, labels map[string]string, writer ImagesWriter, logger Logger) (string, error)

Push the OCI Image to the registry

type ImagesDescriptor

type ImagesDescriptor interface {
	Get(regname.Reference) (*regremote.Descriptor, error)
}

type ImagesWriter

type ImagesWriter interface {
	WriteImage(regname.Reference, regv1.Image, chan regv1.Update) error
	WriteTag(ref regname.Tag, taggagle regremote.Taggable) error
}

ImagesWriter defines the needed functions to write to the registry

type Logger

type Logger interface {
	Logf(string, ...interface{})
}

Logger logs information

type PlainImage

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

PlainImage struct that represents an OCI Image

func NewFetchedPlainImageWithTag

func NewFetchedPlainImageWithTag(digestRef string, tag string, fetchedImage regv1.Image) *PlainImage

NewFetchedPlainImageWithTag creates the struct that represents the OCI Image reference by the fetchedImage This function should only be used after an initial retrieval of information from registry

func NewPlainImage

func NewPlainImage(ref string, imgDescriptor ImagesDescriptor) *PlainImage

NewPlainImage creates the struct that represents the OCI Image referenced by ref

func (*PlainImage) Digest

func (i *PlainImage) Digest() string

Digest Image Digest

func (*PlainImage) DigestRef

func (i *PlainImage) DigestRef() string

DigestRef Image full location including registry, repository and digest

func (*PlainImage) Fetch

func (i *PlainImage) Fetch() (regv1.Image, error)

Fetch the information about the referenced image

func (*PlainImage) IsImage

func (i *PlainImage) IsImage() (bool, error)

IsImage checks if the provided reference is an OCI Image

func (*PlainImage) Pull

func (i *PlainImage) Pull(outputPath string, logger Logger) error

Pull the OCI Image to disk

func (*PlainImage) Repo

func (i *PlainImage) Repo() string

Repo Repository where the image is stored

func (*PlainImage) Tag

func (i *PlainImage) Tag() string

Tag of the image or "" if the image is referenced by digest

Jump to

Keyboard shortcuts

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