reference

package
v0.0.0-...-8680cc4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalid is used to return error if reference is invalid
	ErrInvalid = errors.New("invalid reference")
)

Functions

func IsCanonicalDigested

func IsCanonicalDigested(ref Named) bool

IsCanonicalDigested return true if the ref is the canonical digested reference.

func IsNameTagged

func IsNameTagged(ref Named) bool

IsNameTagged return true if the ref is the Named with tag.

func IsNamedOnly

func IsNamedOnly(ref Named) bool

IsNamedOnly return true if the ref is the Named without tag or digest.

Types

type CanonicalDigested

type CanonicalDigested interface {
	Named
	Digest() digest.Digest
}

CanonicalDigested is an object which doesn't contains the tag information.

type Digested

type Digested interface {
	Reference
	Digest() digest.Digest
}

Digested is an object which is digest.

type Named

type Named interface {
	Reference
	Name() string
}

Named is an object which has full name.

func Parse

func Parse(ref string) (Named, error)

Parse parses ref into reference.Named.

func TrimTagForDigest

func TrimTagForDigest(named Named) Named

TrimTagForDigest removes the tag information if the Named reference is digest.

func WithDefaultTagIfMissing

func WithDefaultTagIfMissing(named Named) Named

WithDefaultTagIfMissing adds default tag "latest" for the Named reference.

func WithDigest

func WithDigest(named Named, dig digest.Digest) Named

WithDigest adds digest for the Named reference.

func WithTag

func WithTag(named Named, tag string) Named

WithTag adds tag for the Named reference.

type Reference

type Reference interface {
	String() string
}

Reference represents image name which may include hub/namespace/name:tag like registry.hub.docker.com/library/ubuntu:latest.

type Tagged

type Tagged interface {
	Named
	Tag() string
}

Tagged is an Named object contains tag.

Jump to

Keyboard shortcuts

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