ps

package
v0.0.0-...-75a46ef Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: BSD-3-Clause, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(task structs.Task)

Run - interface method that retrieves a process list

Types

type Process

type Process interface {
	// Pid is the process ID for this process.
	Pid() int

	// PPid is the parent process ID for this process.
	PPid() int

	// Arch is the x64 or x86
	Arch() string

	// Executable name running this process. This is not a path to the
	// executable.
	Executable() string

	// Owner is the account name of the process owner.
	Owner() string

	// bin_path of the running process
	BinPath() string

	// arguments
	ProcessArguments() []string

	//environment
	ProcessEnvironment() map[string]interface{}

	SandboxPath() string

	ScriptingProperties() map[string]interface{}

	Name() string

	BundleID() string
}

Process - platform agnostic Process interface

func Processes

func Processes() ([]Process, error)

type ProcessArray

type ProcessArray struct {
	Results []ProcessDetails `json:"Processes"`
}

ProcessArray - struct that will hold all of the Process results

type ProcessDetails

type ProcessDetails struct {
	ProcessID           int                    `json:"process_id"`
	ParentProcessID     int                    `json:"parent_process_id"`
	Arch                string                 `json:"architecture"`
	User                string                 `json:"user"`
	BinPath             string                 `json:"bin_path"`
	Arguments           []string               `json:"args"`
	Environment         map[string]interface{} `json:"env"`
	SandboxPath         string                 `json:"sandboxpath"`
	ScriptingProperties map[string]interface{} `json:"scripting_properties"`
	Name                string                 `json:"name"`
	BundleID            string                 `json:"bundleid"`
}

type UnixProcess

type UnixProcess struct {
	// contains filtered or unexported fields
}

UnixProcess is an implementation of Process that contains Unix-specific fields and information.

func (*UnixProcess) Arch

func (p *UnixProcess) Arch() string

func (*UnixProcess) BinPath

func (p *UnixProcess) BinPath() string

func (*UnixProcess) BundleID

func (p *UnixProcess) BundleID() string

func (*UnixProcess) Executable

func (p *UnixProcess) Executable() string

Executable returns the process name

func (*UnixProcess) Name

func (p *UnixProcess) Name() string

func (*UnixProcess) Owner

func (p *UnixProcess) Owner() string

Owner returns the username the process belongs to

func (*UnixProcess) PPid

func (p *UnixProcess) PPid() int

PPid returns the parent process identifier

func (*UnixProcess) Pid

func (p *UnixProcess) Pid() int

Pid returns the process identifier

func (*UnixProcess) ProcessArguments

func (p *UnixProcess) ProcessArguments() []string

func (*UnixProcess) ProcessEnvironment

func (p *UnixProcess) ProcessEnvironment() map[string]interface{}

func (*UnixProcess) Refresh

func (p *UnixProcess) Refresh() error

Refresh reloads all the data associated with this process.

func (*UnixProcess) SandboxPath

func (p *UnixProcess) SandboxPath() string

func (*UnixProcess) ScriptingProperties

func (p *UnixProcess) ScriptingProperties() map[string]interface{}

Jump to

Keyboard shortcuts

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