Documentation
¶
Index ¶
- Variables
- func PidOf(name string) (res []int)
- func Reap() error
- func Run(arg ...string) error
- func RunGet(arg ...string) ([]byte, error)
- func RunJson(obj interface{}, arg ...string) error
- func RunWrite(r io.Reader, arg ...string) error
- func Sh(cmd string) error
- func ShQuote(s string) string
- type LinuxProcState
- type Pipe
- type ProcState
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCommandMissing = errors.New("command is missing") ErrNotSupported = errors.New("operation not supported on this platform") )
Functions ¶
func Run ¶
Run is a very simple invokation of command run, with output forwarded to stdout. This will wait for the command to complete.
func RunJson ¶
RunJson executes the command and applies its output to the specified object, parsing json data
Types ¶
type LinuxProcState ¶ added in v0.2.0
type LinuxProcState struct {
Pid int
Comm string // "bash", etc
State byte // 'R', 'S', 'D', 'Z', 'T', 't', 'W', etc
PPid int // parent pid
PGrp int // group id
Session int // session
TtyNr int // tty number
Tpgid int
Flags uint // PF_* flags
Minflt uint64 // faults
Cminflt uint64
Majflt uint64
Cmajflt uint64
Utime uint64
Stime uint64
Cutime uint64
Cstime uint64
Priority int64
Nice int64 // range 19 (low priority) to -20 (high priority).
NumThreads int64
Itrealvalue int64 // The time in jiffies before the next SIGALRM
StartTime uint64 // The time the process started after system boot in clock ticks (_SYSTEM_CLK_TCK)
Vsize uint64
RSS int64
RSSlim uint64
}
func LinuxPidState ¶ added in v0.2.0
func LinuxPidState(pid uint64) (*LinuxProcState, error)
func (*LinuxProcState) IsRunning ¶ added in v0.2.0
func (s *LinuxProcState) IsRunning() bool
Click to show internal directories.
Click to hide internal directories.