computeDiffID reads all input from layerStream, uncompresses it using decompressor if necessary, and returns its digest.
(stream io.Reader, decompressor compressiontypes.DecompressorFunc)
| 978 | |
| 979 | // computeDiffID reads all input from layerStream, uncompresses it using decompressor if necessary, and returns its digest. |
| 980 | func computeDiffID(stream io.Reader, decompressor compressiontypes.DecompressorFunc) (digest.Digest, error) { |
| 981 | if decompressor != nil { |
| 982 | s, err := decompressor(stream) |
| 983 | if err != nil { |
| 984 | return "", err |
| 985 | } |
| 986 | defer s.Close() |
| 987 | stream = s |
| 988 | } |
| 989 | |
| 990 | return digest.Canonical.FromReader(stream) |
| 991 | } |
| 992 | |
| 993 | // algorithmsByNames returns slice of Algorithms from a sequence of Algorithm Names |
| 994 | func algorithmsByNames(names iter.Seq[string]) ([]compressiontypes.Algorithm, error) { |
searching dependent graphs…