Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KillByNamePattern ¶
KillByNamePattern kills processes by name regex pattern. It returns an error if any occurred.
Types ¶
type CommandExecutor ¶
type CommandExecutor interface {
ExecuteCommand(stdout, stderr *bytes.Buffer, command string, args ...string) error
}
CommandExecutor is an interface to abstract command execution
type ProcessFilter ¶
type ProcessFilter struct { Attrs map[string]string CommandExecutor CommandExecutor }
ProcessFilter represents a map-based configuration for filtering the list of processes.
func NewLiveProcessFilter ¶
func NewLiveProcessFilter(attrs map[string]string) ProcessFilter
func (ProcessFilter) ListProcesses ¶
func (pf ProcessFilter) ListProcesses() ([]map[string]string, error)
ListProcesses fetches and filters processes based on the underlying OS and the provided filter configuration. It returns a slice of maps, each representing a process, and an error if any occurred.
type RealCommandExecutor ¶
type RealCommandExecutor struct{}
RealCommandExecutor is a real implementation of the CommandExecutor interface.
func (RealCommandExecutor) ExecuteCommand ¶
Click to show internal directories.
Click to hide internal directories.