github.com/cdoern/storage@v1.12.13/pkg/chrootarchive/diff.go (about) 1 package chrootarchive 2 3 import ( 4 "io" 5 6 "github.com/containers/storage/pkg/archive" 7 ) 8 9 // ApplyLayer parses a diff in the standard layer format from `layer`, 10 // and applies it to the directory `dest`. The stream `layer` can only be 11 // uncompressed. 12 // Returns the size in bytes of the contents of the layer. 13 func ApplyLayer(dest string, layer io.Reader) (size int64, err error) { 14 return applyLayerHandler(dest, layer, &archive.TarOptions{}, true) 15 } 16 17 // ApplyUncompressedLayer parses a diff in the standard layer format from 18 // `layer`, and applies it to the directory `dest`. The stream `layer` 19 // can only be uncompressed. 20 // Returns the size in bytes of the contents of the layer. 21 func ApplyUncompressedLayer(dest string, layer io.Reader, options *archive.TarOptions) (int64, error) { 22 return applyLayerHandler(dest, layer, options, false) 23 }