ps

package
v0.0.0-...-05f333e Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ps provides a way to find a process in linux without using the ps CLI tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinuxClient

type LinuxClient struct{}

LinuxClient is for finding processes on linux distributions.

func (LinuxClient) Find

func (p LinuxClient) Find(exeMatch string) ([]Process, error)

Find finds all processes with the executable path matching the provided regex.

type Process

type Process struct {
	// Pid is the process id.
	Pid int

	// Exe is the path of the processes executable file.
	Exe string

	// CommandLine contains the processes executable path and its command
	// line arguments (honoring the order they were presented when executed).
	CommandLine []string
}

Process describes an OS process.

func Find

func Find(exeMatch string) ([]Process, error)

Find finds all processes with the executable matching the provided regex.

type ProcessInterface

type ProcessInterface interface {
	Find(exeMatch string) ([]Process, error)
}

ProcessInterface is the minimum required Ps interface for Guest Agent.

var Client ProcessInterface

Client for finding processes.

Jump to

Keyboard shortcuts

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