Versions in this module Expand all Collapse all v1 v1.0.3 Sep 22, 2022 v1.0.2 Sep 22, 2022 Changes in this version type Manager + func (that *Manager) SearchProc(name string) (value IProc, found bool) v1.0.1 Sep 22, 2022 Changes in this version + type IProc interface + Clone func() (*ProcessPlus, error) + GetProcessInfo func() *Info + StartProc func(wait bool) + StopProc func(wait bool) + type Manager struct + ProcessList map[string]IProc + func NewManager() *Manager + func (that *Manager) Add(name string, process IProc) + func (that *Manager) Clear() + func (that *Manager) GetAllProcs() []IProc + func (that *Manager) GetAllProcsInfo() ([]*Info, error) + func (that *Manager) GracefulReload(name string, wait bool) (bool, error) + func (that *Manager) Iterate(f func(key string, value IProc) bool) + func (that *Manager) NewProcess(name string, options ...Option) (p *ProcessPlus, err error) + func (that *Manager) Remove(name string) (value IProc) + func (that *Manager) Search(name string) (value IProc, found bool) + func (that *Manager) StopAllProcs() v1.0.0 Sep 7, 2022 Changes in this version + type AutoReStart string + const AutoReStartFalse + const AutoReStartTrue + const AutoReStartUnexpected + type Info struct + Description string + ExitStatus int + Logfile string + Name string + Now int + Pid int + SpawnErr string + Start int + State int + StateName string + StderrLogfile string + StdoutLogfile string + Stop int + type Option func(p *ProcessPlus) + func ProcArgs(args []string) Option + func ProcAutoReStart(a AutoReStart) Option + func ProcDirectory(dir string) Option + func ProcEnvVar(key, value string) Option + func ProcEnvVarByMap(envs map[string]string) Option + func ProcExitCodes(codes ...int) Option + func ProcExtraFiles(fList []*os.File) Option + func ProcKillAsGroup(kag bool) Option + func ProcKillWaitSecs(t int) Option + func ProcName(name string) Option + func ProcPath(path string) Option + func ProcPriority(pri int) Option + func ProcRedirectStderr(r bool) Option + func ProcRestartPause(t int) Option + func ProcRestartWhenBinaryChanged(rwc bool) Option + func ProcSetExtend(key, value interface{}) Option + func ProcStartRetries(rts int) Option + func ProcStartSecs(t int) Option + func ProcStderrLog(file, maxBytes string, backups ...int) Option + func ProcStdoutLog(file, maxBytes string, backups ...int) Option + func ProcStopAsGroup(sag bool) Option + func ProcStopSignal(sigs ...string) Option + func ProcStopWaitSecs(t int) Option + func ProcUser(user string) Option + type ProcManager struct + Container *gmap.StrAnyMap + func NewProcManager() *ProcManager + func (that *ProcManager) Add(name string, proc *ProcessPlus) + func (that *ProcManager) Clear() + func (that *ProcManager) Find(name string) *ProcessPlus + func (that *ProcManager) ForEachProcess(procFunc func(p *ProcessPlus)) + func (that *ProcManager) GetAllProcessInfo() ([]*Info, error) + func (that *ProcManager) GracefulReload(name string, wait bool) (bool, error) + func (that *ProcManager) NewProcess(name string, options ...Option) (p *ProcessPlus, err error) + func (that *ProcManager) Remove(name string) *ProcessPlus + func (that *ProcManager) StopAllProcesses() + type ProcSettings struct + AutoReStart AutoReStart + AutoStart bool + Environment *gmap.StrStrMap + ExitCodes []int + Extend *gmap.AnyAnyMap + KillAsGroup bool + KillWaitSecs int + Priority int + RedirectStderr bool + RestartPause int + RestartWhenBinaryChanged bool + StartRetries int + StartSecs int + StderrLogFileBackups int + StderrLogFileMaxBytes int + StderrLogfile string + StdoutLogFileBackups int + StdoutLogFileMaxBytes int + StdoutLogfile string + StopAsGroup bool + StopSignal []string + StopWaitSecs int + User string + func GetDefaultProcSettings() *ProcSettings + type ProcState int + const Exist + const Exited + const Failure + const Fatal + const Running + const Starting + const Stopped + const Stopping + const Suspend + const Unknown + func (ps *ProcState) ToString() string + type ProcessPlus struct + Lock sync.RWMutex + Name string + ProcManager *ProcManager + RetryTimes *int32 + StartTime time.Time + Starting bool + State ProcState + StderrLog proclog.Logger + Stdin io.WriteCloser + StdoutLog proclog.Logger + StopByUser bool + StopTime time.Time + func NewProcess(path, name string) (p *ProcessPlus) + func (that *ProcessPlus) Clone() (*ProcessPlus, error) + func (that *ProcessPlus) CreateStderrLogger() proclog.Logger + func (that *ProcessPlus) CreateStdoutLogger() proclog.Logger + func (that *ProcessPlus) FailToStartProgram(reason string, finishCb func()) + func (that *ProcessPlus) GetDescription() string + func (that *ProcessPlus) GetExitCode() (int, error) + func (that *ProcessPlus) GetExitCodes() []int + func (that *ProcessPlus) GetExitStatus() int + func (that *ProcessPlus) GetProcessInfo() *Info + func (that *ProcessPlus) GetStatus() string + func (that *ProcessPlus) GetStderrLogfile() string + func (that *ProcessPlus) GetStdoutLogfile() string + func (that *ProcessPlus) InExitCodes(exitCode int) bool + func (that *ProcessPlus) Init() (err error) + func (that *ProcessPlus) IsAutoRestart() bool + func (that *ProcessPlus) IsRunning() bool + func (that *ProcessPlus) MonitorProgramIsRunning(endTime time.Time, monitorExited *int32, programExited *int32) + func (that *ProcessPlus) Pid() int + func (that *ProcessPlus) RunProc(finishCb func()) + func (that *ProcessPlus) SendSignal(sig os.Signal, sigChildren bool) error + func (that *ProcessPlus) SendSignals(sigs []string, sigChildren bool) + func (that *ProcessPlus) SetUser() error + func (that *ProcessPlus) Signal(sig os.Signal, sigChildren bool) error + func (that *ProcessPlus) StartProc(wait bool) + func (that *ProcessPlus) StopProc(wait bool) + func (that *ProcessPlus) WaitForExit(_ int64)