Documentation ¶
Overview ¶
Package processmgr manages processes launched by avash
Index ¶
- Variables
- type InputHandler
- type OutputHandler
- type Process
- type ProcessManager
- func (pm *ProcessManager) AddProcess(cmdstr string, proctype string, args []string, name string, metadata string, ...) error
- func (pm *ProcessManager) HasRunning() bool
- func (pm *ProcessManager) KillAllProcesses()
- func (pm *ProcessManager) KillProcess(name string) error
- func (pm *ProcessManager) Metadata(name string) (string, error)
- func (pm *ProcessManager) ProcessSummary() *[][]string
- func (pm *ProcessManager) ProcessTable(table *tablewriter.Table) *tablewriter.Table
- func (pm *ProcessManager) RemoveAllProcesses()
- func (pm *ProcessManager) RemoveProcess(name string) error
- func (pm *ProcessManager) StartAllProcesses()
- func (pm *ProcessManager) StartProcess(name string) error
- func (pm *ProcessManager) StopAllProcesses()
- func (pm *ProcessManager) StopProcess(name string) error
Constants ¶
This section is empty.
Variables ¶
var ProcManager = ProcessManager{ // contains filtered or unexported fields }
ProcManager is a global
Functions ¶
This section is empty.
Types ¶
type InputHandler ¶
InputHandler is a generic function for handling input from cin
type OutputHandler ¶
OutputHandler recieves the information
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process declares the necessary data for tracking a process
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
ProcessManager is a system for managing processes in the system
func (*ProcessManager) AddProcess ¶
func (pm *ProcessManager) AddProcess(cmdstr string, proctype string, args []string, name string, metadata string, ih InputHandler, oh OutputHandler, eh OutputHandler) error
AddProcess places a process into the process manager with an associated name
func (*ProcessManager) HasRunning ¶
func (pm *ProcessManager) HasRunning() bool
HasRunning returns true if there exists a running process, otherwise false
func (*ProcessManager) KillAllProcesses ¶
func (pm *ProcessManager) KillAllProcesses()
KillAllProcesses calls Kill() on every running process, logging errors
func (*ProcessManager) KillProcess ¶
func (pm *ProcessManager) KillProcess(name string) error
KillProcess kills the process at the name
func (*ProcessManager) Metadata ¶
func (pm *ProcessManager) Metadata(name string) (string, error)
Metadata returns the metadata given the process name
func (*ProcessManager) ProcessSummary ¶
func (pm *ProcessManager) ProcessSummary() *[][]string
ProcessSummary returns data table of all processes and their statuses
func (*ProcessManager) ProcessTable ¶
func (pm *ProcessManager) ProcessTable(table *tablewriter.Table) *tablewriter.Table
ProcessTable returns a formatted metadata table for the data provided
func (*ProcessManager) RemoveAllProcesses ¶
func (pm *ProcessManager) RemoveAllProcesses()
RemoveAllProcesses removes a process from the list of available named processes
func (*ProcessManager) RemoveProcess ¶
func (pm *ProcessManager) RemoveProcess(name string) error
RemoveProcess removes a process from the list of available named processes
func (*ProcessManager) StartAllProcesses ¶
func (pm *ProcessManager) StartAllProcesses()
StartAllProcesses calls Start() on every stopped process, logging errors
func (*ProcessManager) StartProcess ¶
func (pm *ProcessManager) StartProcess(name string) error
StartProcess starts the process at the name
func (*ProcessManager) StopAllProcesses ¶
func (pm *ProcessManager) StopAllProcesses()
StopAllProcesses calls Stop() on every running process, logging errors
func (*ProcessManager) StopProcess ¶
func (pm *ProcessManager) StopProcess(name string) error
StopProcess stops the process at the name