Documentation ¶
Overview ¶
Package untar untars a tarball to disk.
Index ¶
- func AddElementToString(contentToModify string, elementToAdd string, addAfter string, replaceLine bool) (string, bool)
- func ComputeFileHash(filePath string) (string, error)
- func ComputeHash(reader io.Reader) ([]byte, error)
- func ComputeNewHash(a []byte, hashA []byte, b []byte) ([]byte, error)
- func CopyFile(src string, dst string) error
- func ExtractTarGz(body []byte, downloadDir string) error
- func ExtractTarGzInsideZip(body []byte, downloadDir string) error
- func ExtractZip(body []byte, downloadDir string) error
- func ExtractZipFileToDir(zipArchive string, targetDirectory string) error
- func GetBytes(key interface{}) ([]byte, error)
- func IsDebug() bool
- func IsRuntimeServerHealthy(serverBaseUrl string, httpClient *http.Client) error
- func IsWindows() bool
- func MakeFileExecutable(filepath string) error
- func MarshalAndPrintTable(writer io.Writer, in interface{}) error
- func MkDirAllInheritPerm(path string) (os.FileMode, error)
- func ProcessAFileInZipArchive(zipArchive string, filename string, processFunc ProcessFunc) error
- func ReplaceEnvVariablesFromPath(filePath string, envVarPrefix string) ([]byte, error)
- func RunCommand(cmd *exec.Cmd) error
- func SanitizeExtractPath(filePath string, destination string) error
- func SaveReaderToFile(reader io.Reader, fullFilePath string) error
- func Untar(r io.Reader, dir string, isGzipped bool) error
- func WriteTable(items []interface{})
- func WriteToExistingFile(filePath string, contentToWrite []byte) error
- type ProcessFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddElementToString ¶
func ComputeFileHash ¶
func ComputeNewHash ¶
Returns new hash if b has changed from a
func ExtractTarGz ¶
func ExtractTarGzInsideZip ¶
func ExtractZip ¶
func ExtractZipFileToDir ¶
func IsRuntimeServerHealthy ¶
func MakeFileExecutable ¶
func MarshalAndPrintTable ¶
func ProcessAFileInZipArchive ¶
func ProcessAFileInZipArchive(zipArchive string, filename string, processFunc ProcessFunc) error
Opens the zip archive, finds a file that matches "filename" and runs "processFunc" on the bytes
func ReplaceEnvVariablesFromPath ¶
We have to manually swap out environment variables, as Viper's AutomaticEnv() doesn't work with Unmarshal() and the workarounds do not work for nested structures. See https://github.com/spf13/viper/issues/761
func RunCommand ¶
func SanitizeExtractPath ¶
func WriteTable ¶
func WriteTable(items []interface{})
func WriteToExistingFile ¶
Types ¶
type ProcessFunc ¶
Click to show internal directories.
Click to hide internal directories.