Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("Process not found")
ErrNotFound is returned if the process is not found
Functions ¶
func ParseProcMounts ¶
/proc/mounts Currently just gets the "mntonname" since that is all we need.
Types ¶
type KernelVersion ¶
func ParseOSRelease ¶
func ParseOSRelease(data []byte) (KernelVersion, error)
/proc/sys/kernel/osrelease
func (KernelVersion) String ¶
func (k KernelVersion) String() string
type ListAllOpt ¶
type ListAllOpt func(*listAllConf)
ListAllOpt are functional options for listing processes
func WithProcMount ¶
func WithProcMount(mountPoint string) ListAllOpt
WithProcMount sets the mount point for proc
type Process ¶
type Process struct { // Pid is the process ID. Pid int // contains filtered or unexported fields }
Process represents a process from /proc
func ListAll ¶
func ListAll(opts ...ListAllOpt) ([]*Process, error)
ListAll lists all the processes under the proc mount
func (*Process) Stat ¶
func (proc *Process) Stat() (*ProcessStat, error)
Stat returns the contents of /proc/pid/stat
type ProcessStat ¶
ProcessStat contains (some of) the contents of /proc/pid/stat
type ProcessTree ¶
type ProcessTree map[int]*ProcessTreeProc
ProcessTree organizes the processes in a tree you can follow each pid, and each of the processes that have that pid as a parent will be listed as a child
type ProcessTreeProc ¶
type ProcessTreeProc struct { Process Children []*ProcessTreeProc }
ProcessTreeProc is a Process with Children
Click to show internal directories.
Click to hide internal directories.