Documentation
¶
Index ¶
- func CopyDetachable(dst io.Writer, src io.Reader, keys []byte) (written int64, err error)
- func ExecCmd(name string, args ...string) (string, error)
- func ExecCmdWithStdStreams(stdin io.Reader, stdout, stderr io.Writer, name string, args ...string) error
- func GetDeviceNameFromPath(path string) (string, error)
- func GetDeviceUUIDFromPath(devicePath string) (string, error)
- func GetDiskUsageStats(path string) (uint64, uint64, error)
- func GetStattFromPath(path string) (syscall.Stat_t, error)
- func RunUnderSystemdScope(pid int, slice string, unitName string) error
- func StatusToExitCode(status int) int
- type DetachError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDetachable ¶
CopyDetachable is similar to io.Copy but support a detach key sequence to break out.
func ExecCmd ¶
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, name string, args ...string) error
ExecCmdWithStdStreams execute a command with the specified standard streams.
func GetDeviceNameFromPath ¶
GetDeviceNameFromPath iterates through the mounts and matches the one that the provided path is on
func GetDeviceUUIDFromPath ¶
GetDeviceUUIDFromPath accepts a path, and will find the device corresponding to the path and return the UUID of that device
func GetDiskUsageStats ¶
GetDiskUsageStats accepts a path to a directory or file and returns the number of bytes and inodes used by the path
func GetStattFromPath ¶
GetStattFromPath is a helper function that returns the Stat_t object for a given path
func RunUnderSystemdScope ¶
RunUnderSystemdScope adds the specified pid to a systemd scope
func StatusToExitCode ¶
StatusToExitCode converts wait status code to an exit code
Types ¶
type DetachError ¶
type DetachError struct{}
DetachError is special error which returned in case of container detach.
func (DetachError) Error ¶
func (DetachError) Error() string