utils

package
v1.4.2-stable3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 11 Imported by: 4 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 StatusToExitCode

func StatusToExitCode(status int) int

StatusToExitCode converts wait status code to an exit code

func Tar added in v1.1.0

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

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

func TarToFilesystem added in v1.1.0

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

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

func UntarToFileSystem added in v1.1.0

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