MCPcopy Create free account
hub / github.com/containers/image / StringWithinTransport

Method StringWithinTransport

docker/daemon/daemon_transport.go:127–136  ·  view source on GitHub ↗

StringWithinTransport returns a string representation of the reference, which MUST be such that reference.Transport().ParseReference(reference.StringWithinTransport()) returns an equivalent reference. NOTE: The returned string is not promised to be equal to the original input to ParseReference; e.g.

()

Source from the content-addressed store, hash-verified

125// WARNING: Do not use the return value in the UI to describe an image, it does not contain the Transport().Name() prefix;
126// instead, see transports.ImageName().
127func (ref daemonReference) StringWithinTransport() string {
128 switch {
129 case ref.id != "":
130 return ref.id.String()
131 case ref.ref != nil:
132 return reference.FamiliarString(ref.ref)
133 default: // Coverage: Should never happen, NewReference above should refuse such values.
134 panic("Internal inconsistency: daemonReference has empty id and nil ref")
135 }
136}
137
138// DockerReference returns a Docker reference associated with this reference
139// (fully explicit, i.e. !reference.IsNameOnly, but reflecting user intent,

Callers

nothing calls this directly

Calls 2

FamiliarStringFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected