Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Process ¶
type Process interface { // Pid is the process ID for this process. Pid() int // PPid is the parent process ID for this process. PPid() int // Executable name running this process. This is not a path to the // executable. Executable() string // Owner is the account name of the process owner. Owner() string }
Process is the generic interface that is implemented on every platform and provides common operations for processes.
func FindProcess ¶
FindProcess looks up a single process by pid.
Process will be nil and error will be nil if a matching process is not found.
func Processes ¶
Processes returns all processes.
This of course will be a point-in-time snapshot of when this method was called. Some operating systems don't provide snapshot capability of the process table, in which case the process table returned might contain ephemeral entities that happened to be running when this was called.
type UnixProcess ¶
type UnixProcess struct {
// contains filtered or unexported fields
}
UnixProcess is an implementation of Process that contains Unix-specific fields and information.
func (*UnixProcess) CmdLine ¶ added in v1.4.15
func (p *UnixProcess) CmdLine() []string
func (*UnixProcess) Executable ¶
func (p *UnixProcess) Executable() string
Executable returns the process name
func (*UnixProcess) Owner ¶
func (p *UnixProcess) Owner() string
Owner returns the username the process belongs to
func (*UnixProcess) PPid ¶
func (p *UnixProcess) PPid() int
PPid returns the parent process identifier
func (*UnixProcess) Refresh ¶
func (p *UnixProcess) Refresh() error
Refresh reloads all the data associated with this process.