github.com/endophage/docker@v1.4.2-0.20161027011718-242853499895/pkg/chrootarchive/diff.go (about)

     1  package chrootarchive
     2  
     3  import (
     4  	"io"
     5  
     6  	"github.com/docker/docker/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  }