ps

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package ps contains utility functions related to OS processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

type Process struct {
	Pid        int
	PPid       int
	Exe        string
	Cmdline    string
	WorkingDir string
	Children   []*Process
}

func FindProcess

func FindProcess(pid int) (*Process, error)

FindProcess finds the process with a given PID and returns simplified Process struct or error.

func (*Process) Kill

func (p *Process) Kill() error

Kill kills this process and its children.

func (*Process) Tree

func (p *Process) Tree() string

Tree returns a human-readable tree of the process tree.

Jump to

Keyboard shortcuts

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