image

package
v1.6.4-pre.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 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 selects the tag whose semver value best satisfies the constraint. It returns the highest matching tag from cachedTags (e.g. "v1.2.3").

func Join

func Join(parts ...string) string

func MatchesAnyConstraint

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

MatchesAnyConstraint reports whether version satisfies any of the given semver constraints. An empty constraint list matches nothing. A "*" constraint matches any version. An empty version matches only an empty tag or "*". Non-semver versions fall back to exact string match.

func MatchesConfigTags

func MatchesConfigTags(request string, tags []string) bool

MatchesConfigTags reports whether a request tag should select a FunctionConfig tag list. Concrete versions are matched as constraints; if the request is itself a constraint, the highest FunctionConfig tag that parses as a version and satisfies it is used.

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 is a structured representation of a container image reference, broken into registry, sub-path, base name, tag, and digest 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) String

func (p *ParsedImage) String() string

Jump to

Keyboard shortcuts

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