image

package
v1.1.1-pre.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindBestSemverMatch

func FindBestSemverMatch(constraint string, cachedTags []string) (string, error)

FindBestSemverMatch returns the highest semantic-version tag in cachedTags that satisfies constraint, preserving the original tag string (e.g. "v1.2.3"). Entries that cannot be parsed as semantic versions are ignored.

func Join

func Join(parts ...string) string

func MatchesAnyConstraint

func MatchesAnyConstraint(version string, constraints []string) bool

func WithPrefix

func WithPrefix(name, prefix string) string

WithPrefix prepends prefix to a name that contains no slash. An empty prefix, or a name that already contains a slash, is returned unchanged.

Types

type ParsedImage

type ParsedImage struct {
	// The registry part of the image name without trailing slash.
	// Example: ghcr.io
	Registry string
	// The part of the image name between Registry and BaseName without leading or trailing slashes.
	// Example: kptdev/krm-functions-catalog
	SubPath string
	// The last part of the image name, after all slashes, without the leading slash.
	// Example: apply-setters
	BaseName string
	// The tag of the image without the leading colon.
	// Example: v0.2.3
	Tag string
	// The sha256 digest of the image, without the leading @, but containing the `sha256` prefix.
	// Example: sha256:7d89a74f106241391f687fc2985c8e6de597bb21f0d0014def5edc730618d9cc
	Digest string
	// Original contains the unparsed image name. Intended for testing.
	// Should be the same as the output of Full().
	Original string
}

ParsedImage stores an OCI image name split into all of its components.

func Parse

func Parse(fullImageName string) ParsedImage

Parse creates a ParsedImage object from the full image name. Does not guarantee that the input string is a valid reference, unlike regclientref.New().

func (*ParsedImage) Full

func (p *ParsedImage) Full() string

Full reconstructs the full image name from the parsed parts.

func (*ParsedImage) Prefix

func (p *ParsedImage) Prefix() string

Prefix returns the part before BaseName with *no* trailing slash.

func (ParsedImage) Repository

func (p ParsedImage) Repository() string

Repository is the image name without a tag or digest.

Jump to

Keyboard shortcuts

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