Skip to content

Commit

Permalink
run/image: Turn interface into struct and rename
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <a.jung@lancs.ac.uk>
  • Loading branch information
nderjung committed Dec 22, 2020
1 parent 1d4f9dc commit 796e5c6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions run/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ var (
ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", NameTotalLengthMax)
)

// Named is an object with a full name
type Named interface {
// Name returns normalized repository name, like "ubuntu".
Name() string
// String returns full reference, like "ubuntu@sha256:abcdef..."
String() string
// FullName returns full repository name with hostname, like "docker.io/library/ubuntu"
FullName() string
// Hostname returns hostname for the reference, like "docker.io"
Hostname() string
// RemoteName returns the repository component of the full name, like "library/ubuntu"
RemoteName() string
// Image is an object with a full name
type Image struct {
// Name is the normalized repository name, like "ubuntu".
Name string
// String is the full reference, like "ubuntu@sha256:abcdef..."
String string
// FullName is the full repository name with hostname, like "docker.io/library/ubuntu"
FullName string
// Hostname is the hostname for the reference, like "docker.io"
Hostname string
// RemoteName is the the repository component of the full name, like "library/ubuntu"
RemoteName string
}

func Parse(s string) (Reference, error) {
Expand Down

0 comments on commit 796e5c6

Please sign in to comment.