helper

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: Apache-2.0 Imports: 9 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDirectory

func CopyDirectory(source string, destination string) error

CopyDirectory copies source to destination recursively.

func CopyFile

func CopyFile(source string, destination string) error

CopyFile copies source to destination. Before writing, it creates all required parent directories for the destination.

func CopySymlink(source string, destination string) error

CopySymlink copies source to destination. Before writing, it creates all required parent directories for the destination.

func ExtractTarGz

func ExtractTarGz(source string, destination string, stripComponents int) error

ExtractTarGz extracts source GZIP'd TAR file to a destination directory. An arbitrary number of top-level directory components can be stripped from each path.

func ExtractZip

func ExtractZip(source string, destination string, stripComponents int) error

ExtractZip extracts source ZIP file to a destination directory. An arbitrary number of top-level directory components can be stripped from each path.

func FileExists

func FileExists(file string) (bool, error)

FileExists returns whether a file exists taking into account various error cases.

func WriteFile

func WriteFile(filename string, perm os.FileMode, format string, args ...interface{}) error

WriteFile writes a file with the given content. Before writing, it creates all required parent directories for the file.

func WriteFileFromReader

func WriteFileFromReader(filename string, perm os.FileMode, source io.Reader) error

WriteFileFromReader writes a file with the given content from a io.Reader. Before writing, it creates all required parent directories for the file.

func WriteSymlink(oldName string, newName string) error

WriteSymlink creates newName as a symbolic link to oldName. Before writing, it creates all required parent directories for the newName.

Types

This section is empty.

Jump to

Keyboard shortcuts

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