Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstanceTarWriter ¶
type InstanceTarWriter struct {
// contains filtered or unexported fields
}
InstanceTarWriter provides a TarWriter implementation that handles ID shifting and hardlink tracking.
func NewInstanceTarWriter ¶
func NewInstanceTarWriter(writer io.Writer, idmapSet *idmap.IdmapSet) *InstanceTarWriter
NewInstanceTarWriter returns a ContainerTarWriter for the provided target Writer and id map.
func (*InstanceTarWriter) Close ¶
func (ctw *InstanceTarWriter) Close() error
Close finishes writing the tarball.
func (*InstanceTarWriter) ResetHardLinkMap ¶
func (ctw *InstanceTarWriter) ResetHardLinkMap()
ResetHardLinkMap resets the hard link map. Use when copying multiple instances (or snapshots) into a tarball. So that the hard link map doesn't work across different instances/snapshots.
func (*InstanceTarWriter) WriteFile ¶
func (ctw *InstanceTarWriter) WriteFile(name string, srcPath string, fi os.FileInfo, ignoreGrowth bool) error
WriteFile adds a file to the tarball with the specified name using the srcPath file as the contents of the file. The ignoreGrowth argument indicates whether to error if the srcPath file increases in size beyond the size in fi during the write. If false the write will return an error. If true, no error is returned, instead only the size specified in fi is written to the tarball. This can be used when you don't need a consistent copy of the file.
func (*InstanceTarWriter) WriteFileFromReader ¶
WriteFileFromReader streams a file into the tarball using the src reader. A manually generated os.FileInfo should be supplied so that the tar header can be added before streaming starts.