Documentation
¶
Overview ¶
Package name defines structured types for representing image references.
Index ¶
Constants ¶
const (
DefaultRegistry = "index.docker.io"
)
Variables ¶
This section is empty.
Functions ¶
func IsErrBadName ¶
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.
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 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) RegistryStr ¶
RegistryStr returns the registry component of the Registry.
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.