diff.go 791 B

12345678910111213141516171819
  1. package chrootarchive
  2. import "github.com/docker/docker/pkg/archive"
  3. // ApplyLayer parses a diff in the standard layer format from `layer`,
  4. // and applies it to the directory `dest`. The stream `layer` can only be
  5. // uncompressed.
  6. // Returns the size in bytes of the contents of the layer.
  7. func ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error) {
  8. return applyLayerHandler(dest, layer, true)
  9. }
  10. // ApplyUncompressedLayer parses a diff in the standard layer format from
  11. // `layer`, and applies it to the directory `dest`. The stream `layer`
  12. // can only be uncompressed.
  13. // Returns the size in bytes of the contents of the layer.
  14. func ApplyUncompressedLayer(dest string, layer archive.ArchiveReader) (int64, error) {
  15. return applyLayerHandler(dest, layer, false)
  16. }