oci

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidImageFormat     = fmt.Errorf("image string is either invalid or empty")
	ErrInvalidReferenceFormat = fmt.Errorf("reference string is either invalid or empty")
)
View Source
var DigestRegexp = regexp.MustCompile(digestPat)

DigestRegexp matches well-formed digests, including algorithm (e.g. "sha256:<encoded>").

View Source
var DomainRegexp = regexp.MustCompile(domainAndPort)

DomainRegexp matches hostname or IP-addresses, optionally including a port number. It defines the structure of potential domain components that may be part of image names. This is purposely a subset of what is allowed by DNS to ensure backwards compatibility with Docker image names. It may be a subset of DNS domain name, an IPv4 address in decimal format, or an IPv6 address between square brackets (excluding zone identifiers as defined by RFC 6874 or special addresses such as IPv4-Mapped).

View Source
var IdentifierRegexp = regexp.MustCompile(identifier)

IdentifierRegexp is the format for string identifier used as a content addressable identifier using sha256. These identifiers are like digests without the algorithm, since sha256 is used.

View Source
var NameRegexp = regexp.MustCompile(namePat)

NameRegexp is the format for the name component of references, including an optional domain and port, but without tag or digest suffix.

View Source
var ReferenceRegexp = regexp.MustCompile(referencePat)

ReferenceRegexp is the full supported format of a reference. The regexp is anchored and has capturing groups for name, tag, and digest components.

View Source
var TagRegexp = regexp.MustCompile(tag)

TagRegexp matches valid tag names. From docker/docker:graph/tags.go.

Functions

func GetFetcherBuilder

func GetFetcherBuilder[T ~string](name T) func(...any) (Fetcher, error)

func RegisterFetcherBuilder

func RegisterFetcherBuilder[T ~string](name T, builder func(...any) (Fetcher, error))

Types

type Fetcher

type Fetcher interface {
	GetImage(context.Context, ImageType) (*Image, error)
}

type Image

type Image struct {
	Registry   string
	Repository string
	Tag        string
	Digest     digest.Digest
}

func Parse

func Parse(s string) (*Image, error)

func (*Image) DigestOrTag

func (i *Image) DigestOrTag() string

func (*Image) Empty

func (i *Image) Empty() bool

func (*Image) Path

func (i *Image) Path() string

func (*Image) String

func (i *Image) String() string

func (*Image) UpdateDigestOrTag

func (i *Image) UpdateDigestOrTag(ref string) error

type ImageType

type ImageType string
const (
	ImageTypeOpni    ImageType = "opni"
	ImageTypeMinimal ImageType = "minimal"
	ImageTypePlugins ImageType = "plugins"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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