utils

package
v1.7.0-tar Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDetach = errors.New("detached from container")

ErrDetach is an error indicating that the user manually detached from the container.

Functions

func CopyDetachable

func CopyDetachable(dst io.Writer, src io.Reader, keys []byte) (written int64, err error)

CopyDetachable is similar to io.Copy but support a detach key sequence to break out.

func ExecCmd

func ExecCmd(name string, args ...string) (string, error)

ExecCmd executes a command with args and returns its output as a string along with an error, if any

func ExecCmdWithStdStreams

func ExecCmdWithStdStreams(stdin io.Reader, stdout, stderr io.Writer, env []string, name string, args ...string) error

ExecCmdWithStdStreams execute a command with the specified standard streams.

func RunUnderSystemdScope

func RunUnderSystemdScope(pid int, slice string, unitName string) error

RunUnderSystemdScope adds the specified pid to a systemd scope

func Tar

func Tar(source string) (io.ReadCloser, error)

Tar creates a tarball from source and returns a readcloser of it

func TarToFilesystem

func TarToFilesystem(source string, tarball *os.File) error

TarToFilesystem creates a tarball from source and writes to an os.file provided

func UntarToFileSystem

func UntarToFileSystem(dest string, tarball *os.File, options *archive.TarOptions) error

UntarToFileSystem untars an os.file of a tarball to a destination in the filesystem

Types

This section is empty.

Jump to

Keyboard shortcuts

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