osutils

package module
v0.0.0-...-fd70b77 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 5 Imported by: 1 module, 1 package

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.

README

osutils

Golang OS utilities lib

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecShell

func ExecShell(command string) (string, error)

ExecShell execute a shell command (like bash -c 'your command')

func ExecShellTimeout

func ExecShellTimeout(command string, timeout time.Duration, ctx *ShellContext) (string, error)

ExecShellTimeout execute a shell command (like bash -c 'your command') with a timeout. After that time, the process will be cancelled

func ExecShellf

func ExecShellf(command string, args ...interface{}) (string, error)

ExecShellf execute a shell command (like bash -c 'your command') but with format replacements

func GetCmdOutput

func GetCmdOutput(cmd *cmd.Cmd) string

GetCmdOutput join stdout and stderr in a single string from Cmd

func Trunc

func Trunc(str string, num int) string

Trunc truncates string

Types

type ShellContext

type ShellContext struct {
	//CmdRef cmd.Cmd pointer that can be used to set command references that should be killed when a backup deletion of a running job is detected
	CmdRef *cmd.Cmd
}

ShellContext container to transport a Cmd reference

Jump to

Keyboard shortcuts

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