Documentation ¶
Index ¶
- func CreateTarFromDirectory(target, dir string) error
- type CopyOperation
- type MemFS
- func (fs *MemFS) AddLayerByCopyOps(cs []*CopyOperation, w *tar.Writer) error
- func (fs *MemFS) AddLayerByScan(w *tar.Writer) error
- func (fs *MemFS) Checkpoint(newRoot string, sources []string) error
- func (fs *MemFS) Remove() error
- func (fs *MemFS) Reset()
- func (fs *MemFS) UpdateFromTarPath(source string, untar bool) error
- func (fs *MemFS) UpdateFromTarReader(r *tar.Reader, untar bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTarFromDirectory ¶
CreateTarFromDirectory creates a tar archive containing the contents of the given directory. It also compresses the contents with given compression level.
Types ¶
type CopyOperation ¶
type CopyOperation struct {
// contains filtered or unexported fields
}
CopyOperation defines a copy operation that occurred to generate a layer from.
func NewCopyOperation ¶
func NewCopyOperation( srcs []string, srcRoot, workDir, dst, chown string, blacklist []string, internal bool) (*CopyOperation, error)
NewCopyOperation initializes and validates a CopyOperation. Use "internal" to specify if the copy op is used for copying from previous stages.
func (*CopyOperation) Execute ¶
func (c *CopyOperation) Execute() error
Execute performs the actual copying of files specified by the CopyOperation.
type MemFS ¶
type MemFS struct {
// contains filtered or unexported fields
}
MemFS contains a collection of in-memory layers and a merged fs view.
func (*MemFS) AddLayerByCopyOps ¶
func (fs *MemFS) AddLayerByCopyOps(cs []*CopyOperation, w *tar.Writer) error
AddLayerByCopyOps creates an in-memory layer by performing copy operations on the given src-dst pairs. The file system is not modified during this operation. The resulting layer is merged in memory and written to the tar writer.
func (*MemFS) AddLayerByScan ¶
AddLayerByScan creates an in-memory layer by scanning the differences between the file system and existing in-memory merged layers. The resulting layer is merged in memory and written to the tar writer.
func (*MemFS) Checkpoint ¶
Checkpoint relocates the given src files & directories to the given newRoot.
func (*MemFS) Reset ¶
func (fs *MemFS) Reset()
Reset resets the in-memory file system view of the memFS.
func (*MemFS) UpdateFromTarPath ¶
UpdateFromTarPath updates MemFS with the contents of the tarball at the given path. untars the tarball onto the root of MemFS 'untar' specifies if the contents should also be written to disk at the MemFS root or not.