MCPcopy
hub / github.com/google/go-containerregistry / ParseReference

Function ParseReference

pkg/name/ref.go:40–48  ·  view source on GitHub ↗

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

(s string, opts ...Option)

Source from the content-addressed store, hash-verified

38
39// ParseReference parses the string as a reference, either by tag or digest.
40func ParseReference(s string, opts ...Option) (Reference, error) {
41 if t, err := NewTag(s, opts...); err == nil {
42 return t, nil
43 }
44 if d, err := NewDigest(s, opts...); err == nil {
45 return d, nil
46 }
47 return nil, newErrBadName("could not parse reference: %s", s)
48}
49
50type stringConst string
51

Callers 15

TestDiskPushFunction · 0.92
TestPushAndPullContainerFunction · 0.92
copyImagesMethod · 0.92
TestCopyFunction · 0.92
TestCopyWithPlatformFunction · 0.92
mainFunction · 0.92
TestSchema1Function · 0.92
TestPullingForeignLayerFunction · 0.92
TestWriteLayer_ProgressFunction · 0.92
TestWrite_ProgressFunction · 0.92

Calls 3

NewTagFunction · 0.85
NewDigestFunction · 0.85
newErrBadNameFunction · 0.85

Tested by 15

TestDiskPushFunction · 0.74
TestPushAndPullContainerFunction · 0.74
TestCopyFunction · 0.74
TestCopyWithPlatformFunction · 0.74
TestSchema1Function · 0.74
TestPullingForeignLayerFunction · 0.74
TestWriteLayer_ProgressFunction · 0.74
TestWrite_ProgressFunction · 0.74
TestWriteIndex_ProgressFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…