Documentation ¶
Index ¶
- Constants
- func Path_expand(path string) (string, error)
- type Process
- func (p *Process) GetDescription() string
- func (p *Process) GetExitstatus() int
- func (p *Process) GetGroup() string
- func (p *Process) GetName() string
- func (p *Process) GetPid() int
- func (p *Process) GetPriority() int
- func (p *Process) GetStartTime() time.Time
- func (p *Process) GetState() ProcessState
- func (p *Process) GetStatus() string
- func (p *Process) GetStderrLogfile() string
- func (p *Process) GetStdoutLogfile() string
- func (p *Process) GetStopTime() time.Time
- func (p *Process) SendProcessStdin(chars string) error
- func (p *Process) Signal(sig os.Signal, sigChildren bool) error
- func (p *Process) Start(wait bool)
- func (p *Process) Stop(wait bool)
- type ProcessManager
- func (pm *ProcessManager) Add(name string, proc *Process)
- func (pm *ProcessManager) AsyncForEachProcess(procFunc func(p *Process), done chan *Process) int
- func (pm *ProcessManager) Clear()
- func (pm *ProcessManager) CreateProcess(supervisor_id string, config *config.ConfigEntry) *Process
- func (pm *ProcessManager) Find(name string) *Process
- func (pm *ProcessManager) FindMatch(name string) []*Process
- func (pm *ProcessManager) ForEachProcess(procFunc func(p *Process))
- func (pm *ProcessManager) Remove(name string) *Process
- func (pm *ProcessManager) StartAutoStartPrograms()
- func (pm *ProcessManager) StopAllProcesses()
- type ProcessState
Constants ¶
View Source
const ( STOPPED ProcessState = iota STARTING = 10 RUNNING = 20 BACKOFF = 30 STOPPING = 40 EXITED = 100 FATAL = 200 UNKNOWN = 1000 )
Variables ¶
This section is empty.
Functions ¶
func Path_expand ¶
Types ¶
type Process ¶
type Process struct { StdoutLog logger.Logger StderrLog logger.Logger // contains filtered or unexported fields }
func NewProcess ¶
func NewProcess(supervisor_id string, config *config.ConfigEntry) *Process
func (*Process) GetDescription ¶
func (*Process) GetExitstatus ¶
func (*Process) GetPriority ¶
func (*Process) GetStartTime ¶
func (*Process) GetStderrLogfile ¶
func (*Process) GetStdoutLogfile ¶
func (*Process) GetStopTime ¶
func (*Process) SendProcessStdin ¶
func (*Process) Signal ¶
send signal to the process
Args:
sig - the signal to the process sigChildren - true: send the signal to the process and its children proess
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
func NewProcessManager ¶
func NewProcessManager() *ProcessManager
func (*ProcessManager) Add ¶
func (pm *ProcessManager) Add(name string, proc *Process)
func (*ProcessManager) AsyncForEachProcess ¶
func (pm *ProcessManager) AsyncForEachProcess(procFunc func(p *Process), done chan *Process) int
handle each process in async mode Args: - procFunc, the function to handle the process - done, signal the process is completed Returns: number of total processes
func (*ProcessManager) CreateProcess ¶
func (pm *ProcessManager) CreateProcess(supervisor_id string, config *config.ConfigEntry) *Process
func (*ProcessManager) Find ¶
func (pm *ProcessManager) Find(name string) *Process
return process if found or nil if not found
func (*ProcessManager) FindMatch ¶
func (pm *ProcessManager) FindMatch(name string) []*Process
func (*ProcessManager) ForEachProcess ¶
func (pm *ProcessManager) ForEachProcess(procFunc func(p *Process))
process each process in sync mode
func (*ProcessManager) Remove ¶
func (pm *ProcessManager) Remove(name string) *Process
remove the process from the manager
Arguments: name - the name of program
Return the process or nil
func (*ProcessManager) StartAutoStartPrograms ¶
func (pm *ProcessManager) StartAutoStartPrograms()
func (*ProcessManager) StopAllProcesses ¶
func (pm *ProcessManager) StopAllProcesses()
type ProcessState ¶
type ProcessState int
func (ProcessState) String ¶
func (p ProcessState) String() string
Click to show internal directories.
Click to hide internal directories.