gxprocess

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0, MIT Imports: 6 Imported by: 3

Documentation

Overview

packaeg gxprocess is used to get process info of "/proc"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinuxProcess

type LinuxProcess struct {
	// contains filtered or unexported fields
}

LinuxProcess is an Linux-specific Process information.

func NewLinuxProcess

func NewLinuxProcess(pid int) (*LinuxProcess, error)

func (*LinuxProcess) Executable

func (p *LinuxProcess) Executable() string

func (*LinuxProcess) PPid

func (p *LinuxProcess) PPid() int

func (*LinuxProcess) Pid

func (p *LinuxProcess) Pid() int

func (*LinuxProcess) Refresh

func (p *LinuxProcess) Refresh() error

Refresh reloads all the data associated with this process.

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
}

Process is the generic interface that is implemented on every platform and provides common operations for processes.

func FindProcess

func FindProcess(pid int) (Process, error)

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

func Processes() ([]Process, error)

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.

Jump to

Keyboard shortcuts

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