Documentation ¶
Index ¶
- func AddFileToTar(archive *tar.Writer, dir string, file string) error
- func AddFileToZip(archive *zip.Writer, dir string, file string, compress bool) error
- func Copy(fromMode fs.FileMode, path string, dest string) error
- func CopyDirectory(path string, dest string) error
- func CopyFile(path string, dest string) error
- func CopySymLink(source, dest string) error
- func ExtractTarFile(tarFile string, location string) error
- func GetTotalSystemMemory() uint64
- func NativeCompressionReader(r io.Reader, algorithm string) io.ReadCloser
- func NativeCompressionWriter(w io.Writer, algorithm string) io.WriteCloser
- func UnzipFile(zipFile string, location string) error
- type ProcessStats
- type Stat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFileToTar ¶
AddFileToTar adds a file/folder to a tar.Writer.
func AddFileToZip ¶
AddFileToZip adds a file or folder to a zip.Writer using Deflate.
func CopyDirectory ¶
CopyDirectory copies a folder from one place to another. Requires the destination path to exist already.
func CopySymLink ¶
CopySymlink copies a symlink from one place to another.
func ExtractTarFile ¶
ExtractTarFile extracts a tar archive to a location. It supports gzip and bzip2 natively, and xz/zstd if installed on your system on the CLI.
func GetTotalSystemMemory ¶
func GetTotalSystemMemory() uint64
GetTotalSystemMemory gets the total system memory in the current system.
func NativeCompressionReader ¶
func NativeCompressionReader(r io.Reader, algorithm string) io.ReadCloser
NativeCompressionReader can use xz/zstd installed in your system PATH for decompression.
func NativeCompressionWriter ¶
func NativeCompressionWriter(w io.Writer, algorithm string) io.WriteCloser
NativeCompressionWriter can use xz/zstd installed in your system PATH for compression. It uses zstd long distance mode for better compression.
Types ¶
type ProcessStats ¶
ProcessStats is statistics of a process.
func GetProcessStats ¶
func GetProcessStats(pid int) (ProcessStats, error)
GetProcessStats gets the stats of a process.