ps

package module
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 5 Imported by: 13

README

gops

Go process tools

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindIds

func FindIds(name string) ([]int, error)

FindIds finds the all processes named with a subset of "name" (case insensitive), return matched IDs.

func FindName

func FindName(pid int) (string, error)

FindName find the process name by the process id

func FindNames

func FindNames() ([]string, error)

FindNames find the all process name

func FindPath

func FindPath(pid int) (string, error)

FindPath find the process path by the process pid

func GetPid

func GetPid() int

GetPid get the process id

func IsRun added in v0.21.0

func IsRun(pid int) (bool, error)

IsRun return the process is runing or not

func Kill

func Kill(pid int) error

Kill kill the process by PID

func PidExists

func PidExists(pid int) (bool, error)

PidExists determine whether the process exists

func Pids

func Pids() ([]int, error)

Pids get the all process id

func Run added in v0.21.0

func Run(path string) ([]byte, error)

Run command shell

func Status added in v0.21.0

func Status(pid int) ([]string, error)

Status return the process status

func ToInt added in v0.30.0

func ToInt(pid []int32) (res []int)

ToInt convert []int32 to []int

Types

type Nps

type Nps struct {
	// Pid  int32
	Pid  int
	Name string
}

Nps process struct

func Process

func Process() ([]Nps, error)

Process get the all process struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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