Documentation ¶
Index ¶
- Variables
- func FindPGid(name string) (int, error)
- func FindPid(name string) (int, error)
- func FindPpid(name string) (int, error)
- func GetPidState(pid int) (string, error)
- func GetPids() ([]int, error)
- func PidIsExists(pid int) (bool, error)
- func ProcessIsExists(name string) (bool, error)
- func StateToString(state string) string
- type Process
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoProcess = errors.New("no process with provided name found")
)
Functions ¶
func GetPidState ¶ added in v0.2.0
GetPidState returns state for given process id
func PidIsExists ¶ added in v0.2.0
ProcessIsExists return true if given pid is exists
func ProcessIsExists ¶ added in v0.2.0
ProcessIsExists return true if given process name is exists
func StateToString ¶ added in v0.2.0
StateToString returns state representation for given state
Types ¶
type Process ¶
type Process struct { // The process id Pid int // The executable filename of running process Comm string // Full command line of running process CmdLine string // state of this process State string // The parent process id from this process Ppid int // The process group id from this process Pgrp int // The User id and group id who running process UID, GID int }
Process contains information about running process
func FindProcess ¶ added in v0.2.0
FindProcess returns Process struct from given process id
func FindProcessName ¶ added in v0.3.0
FindProcessName returns Process based on finding, it will be match if given process name same with executable filename
func FindProcessNameContains ¶ added in v0.3.0
FindProcessNameContains returns slice of Process based on finding, it will returns process containing name. Using this is not very accurate, if you want to search process based on executable file name, use FindProcessName instead
func GetProcess ¶
GetProcess returns all process information pid, comm, ppid, pgrp