ps

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string) error

Types

type Config

type Config struct {
	All    bool   `flag:"" desc:"Show all processes"`
	Full   bool   `flag:"" desc:"Show full command details"`
	PID    string `flag:"" desc:"Filter by PID"`
	SortBy string `flag:"" desc:"Sort by field (e.g., pid, cpu, mem)"`
	XML    bool
	JSON   bool
	Plain  bool
	Pretty bool
}

type Process

type Process struct {
	XMLName   xml.Name `xml:"process"`
	PID       int      `xml:"pid,attr"`
	PPID      int      `xml:"ppid,attr"`
	User      string   `xml:"user,attr"`
	UID       string   `xml:"uid,attr"`
	State     string   `xml:"state,attr"`
	StateDesc string   `xml:"state_desc,attr"`
	CPUPct    float64  `xml:"cpu_pct,attr"`
	MemPct    float64  `xml:"mem_pct,attr"`
	VSZKB     int64    `xml:"vsz_kb,attr"`
	RSSKB     int64    `xml:"rss_kb,attr"`
	Started   string   `xml:"started,attr"`
	Command   string   `xml:"command,attr"`
	Args      string   `xml:"args,attr"`
	Exe       string   `xml:"exe,attr"`
}

type PsError

type PsError struct {
	XMLName xml.Name `xml:"error"`
	Code    int      `xml:"code,attr"`
	Msg     string   `xml:"msg,attr"`
}

type PsResult

type PsResult struct {
	XMLName   xml.Name  `xml:"ps"`
	Timestamp int64     `xml:"timestamp,attr"`
	Processes []Process `xml:"process,omitempty"`
	Errors    []PsError `xml:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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