ps

package
v0.0.0-...-6f62517 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

ps provides an API for finding and listing processes in a platform-agnostic way.

NOTE: If you're reading these docs online via GoDocs or some other system, you might only see the Unix docs. This project makes heavy use of platform-specific implementations. We recommend reading the source if you are interested.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Processes

func Processes(whitelist []string) (map[string]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.

Types

type Process

type Process struct {
	Pid     int
	Running bool
	Enabled bool
}

type UnixProcess

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

func (*UnixProcess) Enabled

func (p *UnixProcess) Enabled() bool

func (*UnixProcess) Executable

func (p *UnixProcess) Executable() string

func (*UnixProcess) PPid

func (p *UnixProcess) PPid() int

func (*UnixProcess) Pid

func (p *UnixProcess) Pid() int

func (*UnixProcess) Refresh

func (p *UnixProcess) Refresh(whitelist []string) error

Refresh reloads all the data associated with this process.

func (*UnixProcess) Running

func (p *UnixProcess) Running() bool

Jump to

Keyboard shortcuts

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