Documentation ¶
Overview ¶
llps provides an API for finding and listing processes in a platform-agnostic way.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoProcessFound = errors.New("no process found")
Functions ¶
func ErrUnableToFindProcess ¶
ErrUnableToFindProcess is returned when a process is cannot be retrieved.
Types ¶
type Process ¶
type Process struct { // Parent is the information about the parent process. Parent *Process // PID is the process ID for this process. PID int // Executable name running this process. This is not a path to the executable. Executable string }
Process contains information about a running process.
This is generic to all operating systems supported by github.com/mitchellh/go-ps.
func FindProcess ¶
FindProcess looks up a single process by pid.
Thid func will send ErrNoProcessFound 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.