containerimage

package
v2.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

This package provides container image names, registry info and digests.

It should only be used by the CLI and never be imported by any package that ends up in a container image to avoid circular dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Default  Image
	Registry string
	Prefix   string
}

Builder is a builder for container images.

func NewBuilder

func NewBuilder(def Image, registry, prefix string) *Builder

NewBuilder creates a new builder for container images.

func (*Builder) Build

func (b *Builder) Build() Image

Build builds a container image.

type Image

type Image struct {
	// Registry is the registry where the image is located.
	Registry string
	// Prefix is the prefix of the image name.
	Prefix string
	// Name is the name of the image.
	Name string
	// Tag is the tag of the image.
	Tag string
	// Digest is the digest of the image.
	Digest string
}

Image is a container image reference. It has the following format: <registry>/<prefix>/<name>:<tag>@<digest> where <registry> is the registry where the image is located, <prefix> is the (optional) prefix of the image name, <name> is the name of the image, <tag> is the (optional) tag of the image, <digest> is the digest of the image.

func (Image) String

func (i Image) String() string

String returns the image as a string. The format is <registry>/<prefix>/<name>:<tag>@<digest> or a shorter version if prefix or tag are empty.

func (Image) Validate

func (i Image) Validate() error

Validate validates the image.

Jump to

Keyboard shortcuts

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