name

package
v0.0.0-...-ec4d356 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package name defines structured types for representing image references.

Index

Constants

View Source
const (
	DefaultRegistry = "index.docker.io"
)

Variables

This section is empty.

Functions

func IsErrBadName

func IsErrBadName(err error) bool

IsErrBadName returns true if the given error is an ErrBadName.

Types

type Digest

type Digest struct {
	Repository
	// contains filtered or unexported fields
}

Digest stores a digest name in a structured form.

func NewDigest

func NewDigest(name string, strict Strictness) (Digest, error)

NewDigest returns a new Digest representing the given name, according to the given strictness.

func (Digest) Context

func (d Digest) Context() Repository

Context implements Reference.

func (Digest) DigestStr

func (d Digest) DigestStr() string

DigestStr returns the digest component of the Digest.

func (Digest) Identifier

func (d Digest) Identifier() string

Identifier implements Reference.

func (Digest) Name

func (d Digest) Name() string

Name returns the name from which the Digest was derived.

func (Digest) String

func (d Digest) String() string

type ErrBadName

type ErrBadName struct {
	// contains filtered or unexported fields
}

ErrBadName is an error for when a bad docker name is supplied.

func NewErrBadName

func NewErrBadName(fmtStr string, args ...interface{}) *ErrBadName

NewErrBadName returns a ErrBadName which returns the given formatted string from Error().

func (*ErrBadName) Error

func (e *ErrBadName) Error() string

type Reference

type Reference interface {
	fmt.Stringer

	// Context accesses the Repository context of the reference.
	Context() Repository

	// Identifier accesses the type-specific portion of the reference.
	Identifier() string

	// Name is the fully-qualified reference name.
	Name() string

	// Scope is the scope needed to access this reference.
	Scope(string) string
}

Reference defines the interface that consumers use when they can take either a tag or a digest.

func ParseReference

func ParseReference(s string, strict Strictness) (Reference, error)

ParseReference parses the string as a reference, either by tag or digest.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry stores a docker registry name in a structured form.

func NewInsecureRegistry

func NewInsecureRegistry(name string, strict Strictness) (Registry, error)

NewInsecureRegistry returns an Insecure Registry based on the given name. Strict validation requires explicit, valid RFC 3986 URI authorities to be given.

func NewRegistry

func NewRegistry(name string, strict Strictness) (Registry, error)

NewRegistry returns a Registry based on the given name. Strict validation requires explicit, valid RFC 3986 URI authorities to be given.

func (Registry) Name

func (r Registry) Name() string

Name returns the name from which the Registry was derived.

func (Registry) RegistryStr

func (r Registry) RegistryStr() string

RegistryStr returns the registry component of the Registry.

func (Registry) Scheme

func (r Registry) Scheme() string

Scheme returns https scheme for all the endpoints except localhost or when explicitly defined.

func (Registry) Scope

func (r Registry) Scope(string) string

Scope returns the scope required to access the registry.

func (Registry) String

func (r Registry) String() string

type Repository

type Repository struct {
	Registry
	// contains filtered or unexported fields
}

Repository stores a docker repository name in a structured form.

func NewRepository

func NewRepository(name string, strict Strictness) (Repository, error)

NewRepository returns a new Repository representing the given name, according to the given strictness.

func (Repository) Name

func (r Repository) Name() string

Name returns the name from which the Repository was derived.

func (Repository) RepositoryStr

func (r Repository) RepositoryStr() string

RepositoryStr returns the repository component of the Repository.

func (Repository) Scope

func (r Repository) Scope(action string) string

Scope returns the scope required to perform the given action on the registry. TODO(jonjohnsonjr): consider moving scopes to a separate package.

func (Repository) String

func (r Repository) String() string

type Strictness

type Strictness int

Strictness defines the level of strictness for name validation.

const (
	StrictValidation Strictness = iota
	WeakValidation
)

Enums for CRUD operations.

type Tag

type Tag struct {
	Repository
	// contains filtered or unexported fields
}

Tag stores a docker tag name in a structured form.

func NewTag

func NewTag(name string, strict Strictness) (Tag, error)

NewTag returns a new Tag representing the given name, according to the given strictness.

func (Tag) Context

func (t Tag) Context() Repository

Context implements Reference.

func (Tag) Identifier

func (t Tag) Identifier() string

Identifier implements Reference.

func (Tag) Name

func (t Tag) Name() string

Name returns the name from which the Tag was derived.

func (Tag) Scope

func (t Tag) Scope(action string) string

Scope returns the scope required to perform the given action on the tag.

func (Tag) String

func (t Tag) String() string

func (Tag) TagStr

func (t Tag) TagStr() string

TagStr returns the tag component of the Tag.

Jump to

Keyboard shortcuts

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