Categorygithub.com/codemodify/systemkit-processes

# README

Processes

Robust system process management, spawn and monitor,

Supported: Linux, Raspberry Pi, FreeBSD, Mac OS, Windows, Solaris

Install

go get github.com/codemodify/systemkit-processes

API

  
find.ProcessByPID(pid)Find process by PID
find.AllProcesses()Fetches a snapshot of all running processes
 
procMon := monitor.New()Create a new process monitor
procMon.Spawn(template)Spawns and monitors a process based on a template, generates a tag
procMon.SpawnWithTag(template, tag)Spawns and monitors a process based on a template and custom tag
procMon.Start(tag)Starts the process taged with ID
procMon.Stop(tag)Stop the process taged with ID
procMon.Restart(tag)Restart the process taged with ID
procMon.StopAll()Stops all monitored processes
procMon.GetProcess(tag)Gets the running process
procMon.RemoveFromMonitor(tag)Removes a process from being monitred
procMon.GetAllTags()Returns tags for all monitored processes
 
proc.Start()Starts the process
proc.Stop()Stops the process (kills it if needed)
proc.IsRunning()true if process is running
proc.Details()Details about the process, like PID, executable name
proc.ExitCode()Returns the exit code
proc.StartedAt()Started time
proc.StoppedAt()Stopped time

proc.OnStdOut() | Set reader for process STDOUT proc.OnStdErr() | Set reader for process STDERR proc.OnStop() | Set handler when the process stops

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author