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

Method blobPath

pkg/blobcache/blobcache.go:81–90  ·  view source on GitHub ↗

blobPath returns the path appropriate for storing a blob with digest.

(digest digest.Digest, isConfig bool)

Source from the content-addressed store, hash-verified

79
80// blobPath returns the path appropriate for storing a blob with digest.
81func (b *BlobCache) blobPath(digest digest.Digest, isConfig bool) (string, error) {
82 if err := digest.Validate(); err != nil { // Make sure digest.String() does not contain any unexpected characters
83 return "", err
84 }
85 baseName := digest.String()
86 if isConfig {
87 baseName += ".config"
88 }
89 return filepath.Join(b.directory, baseName), nil
90}
91
92// findBlob checks if we have a blob for info in cache (whether a config or not)
93// and if so, returns it path and size, and whether it was stored as a config.

Callers 6

findBlobMethod · 0.95
saveStreamMethod · 0.45
PutBlobWithOptionsMethod · 0.45
PutManifestMethod · 0.45
GetManifestMethod · 0.45
layerInfoForCopyMethod · 0.45

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected