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

Function AlgorithmByName

pkg/compression/compression.go:47–53  ·  view source on GitHub ↗

AlgorithmByName returns the compressor by its name

(name string)

Source from the content-addressed store, hash-verified

45
46// AlgorithmByName returns the compressor by its name
47func AlgorithmByName(name string) (Algorithm, error) {
48 algorithm, ok := compressionAlgorithms[name]
49 if ok {
50 return algorithm, nil
51 }
52 return Algorithm{}, fmt.Errorf("cannot find compressor for %q", name)
53}
54
55// DecompressorFunc returns the decompressed stream, given a compressed stream.
56// The caller must call Close() on the decompressed stream (even if the compressed input stream does not need closing!).

Callers 4

algorithmsByNamesFunction · 0.92
assertCandidatesMatch2Function · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…