1
0
mirror of https://github.com/google/gops.git synced 2024-11-24 08:22:25 +02:00
gops/vendor/github.com/keybase/go-ps
2017-07-28 14:45:08 -07:00
..
darwincgo all: run dep init again 2017-07-28 14:45:08 -07:00
.gitignore all: run dep init again 2017-07-28 14:45:08 -07:00
.pre-commit-config.yaml all: run dep init again 2017-07-28 14:45:08 -07:00
.travis.yml all: run dep init again 2017-07-28 14:45:08 -07:00
appveyor.yml all: run dep init again 2017-07-28 14:45:08 -07:00
LICENSE.md all: run dep init again 2017-07-28 14:45:08 -07:00
process_darwin_test.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_darwin.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_freebsd.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_nix_test.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_openbsd_test.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_openbsd.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_test.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_unix_test.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_unix.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_windows_test.go all: run dep init again 2017-07-28 14:45:08 -07:00
process_windows.go all: run dep init again 2017-07-28 14:45:08 -07:00
process.go all: run dep init again 2017-07-28 14:45:08 -07:00
README.md all: run dep init again 2017-07-28 14:45:08 -07:00

Process List Library for Go

Build Status Build Status Coverage Status GoDoc

go-ps is a library for Go that implements OS-specific APIs to list and manipulate processes in a platform-safe way. The library can find and list processes on Linux, Mac OS X, and Windows.

If you're new to Go, this library has a good amount of advanced Go educational value as well. It uses some advanced features of Go: build tags, accessing DLL methods for Windows, cgo for Darwin, etc.

How it works:

  • Darwin uses sysctl and proc_listpids (for the path) to retrieve the process table, via cgo.
  • Unix uses the procfs at /proc to inspect the process tree.
  • Windows uses the Windows API, and methods such as CreateToolhelp32Snapshot to get a point-in-time snapshot of the process table.

Installation

Install using standard go get:

$ go get github.com/keybase/go-ps