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 GetDiskUsageStats(path string) (uint64, uint64, error)
- func RunUnderSystemdScope(pid int, slice string, unitName string) error
- func StatusToExitCode(status int) int
- func WriteGoroutineStacks(w io.Writer) error
- func WriteGoroutineStacksToFile(path string) error
- type DetachError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDetachable ¶ added in v1.0.0
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 GetDiskUsageStats ¶ added in v1.9.11
GetDiskUsageStats accepts a path to a directory or file and returns the number of bytes and inodes used by the path
func RunUnderSystemdScope ¶ added in v1.0.0
RunUnderSystemdScope adds the specified pid to a systemd scope
func StatusToExitCode ¶
StatusToExitCode converts wait status code to an exit code
func WriteGoroutineStacks ¶ added in v1.11.7
WriteGoroutineStacks writes out the goroutine stacks of the caller. Up to 32 MB is allocated to print the stack.
func WriteGoroutineStacksToFile ¶ added in v1.11.7
WriteGoroutineStacksToFile write goroutine stacks to the specified file.
Types ¶
type DetachError ¶ added in v1.0.0
type DetachError struct{}
DetachError is special error which returned in case of container detach.
func (DetachError) Error ¶ added in v1.0.0
func (DetachError) Error() string