imageref

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package imageref parses container image references and classifies how reproducible they are. It intentionally avoids network access: it only looks at the reference string.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reference

type Reference struct {
	Raw string
	// Registry is the registry host, empty for Docker Hub.
	Registry string
	// Repository is the repository path without registry. Docker Hub
	// official images are returned without the "library/" prefix.
	Repository string
	Tag        string
	Digest     string
}

Reference is a parsed image reference such as "ghcr.io/org/app:1.2.3@sha256:abc...".

func Parse

func Parse(s string) Reference

Parse splits an image reference into its parts. It never fails; invalid references simply produce empty fields.

func (Reference) Kind

func (r Reference) Kind() TagKind

Kind classifies the reference.

type TagKind

type TagKind int

TagKind classifies how mutable a reference is.

const (
	// KindDigest means the reference is pinned to an immutable digest.
	KindDigest TagKind = iota
	// KindVersion is a tag containing a version number, e.g. 1.2.3 or 16-alpine.
	KindVersion
	// KindChannel is a moving tag without any version number, e.g. stable.
	KindChannel
	// KindLatest is the "latest" tag or a variant of it.
	KindLatest
	// KindUntagged has neither tag nor digest and resolves to latest.
	KindUntagged
)

Tag kinds, from most to least reproducible.

Jump to

Keyboard shortcuts

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