kmgProcess

package
v0.0.0-...-05317bf Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdAllProcess

func CmdAllProcess() string

以特定格式化的形式列出所有进程,方便提取进程信息 第一列是进程 ID,第二列是进程完整的执行命令(执行文件或命令+全部执行参数) 兼容:Linux, OS X

func CmdProcessByBinName

func CmdProcessByBinName(binName string) string

只兼容Linux,请用下面的那个命令

Types

type Process

type Process struct {
	Id       int
	Command  string
	StartCmd string
}

func Diff

func Diff(expect, running []*Process) (notExpect, notRunning []*Process)

时间复杂度 2n^2

func Extract

func Extract(psOutput string) []*Process

psOutput 样例 1234 /bin/hi -l :1024 12345 /bin/world -n test

func LinuxGetAllProcessByBinName

func LinuxGetAllProcessByBinName(binName string) []*Process

func (*Process) CmdKill

func (p *Process) CmdKill() string

func (*Process) Kill

func (p *Process) Kill()

杀不死就算了

Jump to

Keyboard shortcuts

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