ref

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 19

Documentation

Overview

Package ref is used to define references. References default to remote registry references (registry:port/repo:tag). Schemes can be included in front of the reference for different reference types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualRegistry

func EqualRegistry(a, b Ref) bool

EqualRegistry compares the registry between two references.

func EqualRepository

func EqualRepository(a, b Ref) bool

EqualRepository compares the repository between two references.

Types

type Ref

type Ref struct {
	Scheme     string // Scheme is the type of reference, "reg" or "ocidir".
	Reference  string // Reference is the unparsed string or common name.
	Registry   string // Registry is the server for the "reg" scheme.
	Repository string // Repository is the path on the registry for the "reg" scheme.
	Tag        string // Tag is a mutable tag for a reference.
	Digest     string // Digest is an immutable hash for a reference.
	Path       string // Path is the directory of the OCI Layout for "ocidir".
}

Ref is a reference to a registry/repository. Direct access to the contents of this struct should not be assumed.

func New

func New(parse string) (Ref, error)

New returns a reference based on the scheme (defaulting to "reg").

func NewHost added in v0.5.4

func NewHost(parse string) (Ref, error)

NewHost returns a Reg for a registry hostname or equivalent. The ocidir schema equivalent is the path.

func (Ref) CommonName

func (r Ref) CommonName() string

CommonName outputs a parsable name from a reference.

func (Ref) IsSet added in v0.5.4

func (r Ref) IsSet() bool

IsSet returns true if needed values are defined for a specific reference.

func (Ref) IsSetRepo added in v0.5.5

func (r Ref) IsSetRepo() bool

IsSetRepo returns true when the ref includes values for a specific repository.

func (Ref) IsZero added in v0.4.4

func (r Ref) IsZero() bool

IsZero returns true if ref is unset.

func (Ref) SetDigest added in v0.5.4

func (r Ref) SetDigest(digest string) Ref

SetDigest returns a ref with the requested digest set. The tag will be unset and the reference value will be reset.

func (Ref) SetTag added in v0.5.4

func (r Ref) SetTag(tag string) Ref

SetTag returns a ref with the requested tag set. The digest will be unset and the reference value will be reset.

func (Ref) ToReg added in v0.4.5

func (r Ref) ToReg() Ref

ToReg converts a reference to a registry like syntax.

Jump to

Keyboard shortcuts

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