ffs

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package ffs contains functions that manipulate file system

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfFileExists added in v0.4.0

func CheckIfFileExists(fileName string) bool

CheckIfFileExists checks if a file exists in the filesystem.

func CreateBuildContext

func CreateBuildContext(dockerfile string) string

CreateBuildContext creates a directory which contains a Dockerfile with the specified content and returns the path to the directory. It is the caller's responsibility to remove the directory when it is no longer needed.

func CreateComposeYmlContext

func CreateComposeYmlContext(composeYmlContent string) (string, string)

CreateComposeYmlContext creates a temp directory along with a docker-compose.yml file. It is the caller's responsibility to remove the directory when it is no longer needed.

func CreateFilePathInHome added in v0.7.7

func CreateFilePathInHome(dirPath string) string

CreateFilePathInHome creates a filepath and returns the path.

func CreateNestedDir added in v0.7.0

func CreateNestedDir(dirPath string) string

CreateNestedDir creates a nested directory and returns the path of the created directory. It is the caller's responsibility to remove the directory when it is no longer needed.

func CreateTarFilePath

func CreateTarFilePath() string

CreateTarFilePath creates a directory and a tar file path appended to the directory and returns the tar file path. It is the caller's responsibility to remove the directory when it is no longer needed. TODO: replace with CreateTempDir.

func CreateTempDir

func CreateTempDir(directoryPrefix string) string

CreateTempDir creates a temp directory and returns the path of the created directory. It is the caller's responsibility to remove the directory when it is no longer needed.

func CreateTempFile

func CreateTempFile(filename string, content string) string

CreateTempFile creates a temp directory which contains a temp file and returns the path to the temp file. It is the caller's responsibility to remove the directory when it is no longer needed.

func DeleteDirectory added in v0.7.0

func DeleteDirectory(directoryPath string)

DeleteDirectory deletes the directory including nested directories.

func WriteFile

func WriteFile(name string, data string)

WriteFile writs data to the file specified by name. The file will be created if not existing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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