From 796e5c62cb20a4789c32b688e23685156a930a53 Mon Sep 17 00:00:00 2001 From: Alexander Jung Date: Tue, 22 Dec 2020 16:49:50 +0100 Subject: [PATCH] run/image: Turn interface into struct and rename Signed-off-by: Alexander Jung --- run/image.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/run/image.go b/run/image.go index 56397be..c151d46 100644 --- a/run/image.go +++ b/run/image.go @@ -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) {