fs

package
v0.0.0-...-55c649e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package fs exports functionality related to all of the cos-customizer state stored on the file system.

Index

Constants

View Source
const (
	// ScratchDir is used for temp files and the like.
	ScratchDir = "/tmp"
)

Variables

This section is empty.

Functions

func ArchiveHasObject

func ArchiveHasObject(archive string, path string) (bool, error)

ArchiveHasObject determines if the given tar archive contains the given object.

func CopyRecursive

func CopyRecursive(src string, dst string) error

CopyRecursive calls 'cp -r <src> <dst>'.

func CreateBuildContextArchive

func CreateBuildContextArchive(src, dst string) error

CreateBuildContextArchive creates a tar archive of the given build context.

func GzipFile

func GzipFile(inPath, outPath string) (err error)

GzipFile compresses the file at the input path and saves the result at the output path.

Types

type Files

type Files struct {

	// UserBuildContextArchive points to the tar archive of the user build context.
	// The user build context contains user provided scripts and files that users can use during preloading.
	UserBuildContextArchive string
	// SourceImageConfig points to the source image configuration.
	SourceImageConfig string
	// BuildConfig points to the image build process configuration.
	BuildConfig string
	// ProvConfig points to the provisioner configuration that runs on the preload
	// VM.
	ProvConfig string
	// DaisyWorkflow points to the Daisy workflow to template and use for preloading.
	DaisyWorkflow string
	// DaisyBin points to the Daisy binary.
	DaisyBin string
	// contains filtered or unexported fields
}

Files stores important file paths.

func DefaultFiles

func DefaultFiles(persistentDir string) *Files

DefaultFiles builds a Files struct with a default file layout.

func (*Files) CleanupAllPersistent

func (f *Files) CleanupAllPersistent() error

CleanupAllPersistent deletes everything in the persistent directory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL