containerimage

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: AGPL-3.0 Imports: 3 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

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