Documentation
¶
Index ¶
- Constants
- func IsRunning(pid int) (bool, int)
- func Kill(pid int) error
- func NewSysProcAttr() *syscall.SysProcAttr
- func PidExist(pid int) bool
- func SetProcessName(name string) error
- type Manager
- func (c *Manager) Check(callback func(pid int))
- func (c *Manager) DaemonProcessIsRunning() (bool, int)
- func (c *Manager) KillProcess(pidFile string) (bool, error)
- func (c *Manager) Logger(logPath string) *log.Logger
- func (c *Manager) MainProcessIsRunning() (bool, int)
- func (c *Manager) Restart(stopCallback func(), startCallback func(pid int))
- func (c *Manager) Start(callback func(pid int))
- func (c *Manager) Stop(callback func()) error
Constants ¶
View Source
const ( PTYPE_START = "start_process" //启动进程 PTYPE_DAEMON = "daemon_process" //守护进程 PTYPE_MAIN = "main_process" //主进程 )
View Source
const VERSION = "1.0.3"
版本号
Variables ¶
This section is empty.
Functions ¶
func NewSysProcAttr ¶
func NewSysProcAttr() *syscall.SysProcAttr
func SetProcessName ¶
Types ¶
type Manager ¶
type Manager struct { Daemon bool //是否守护进程 Background bool //是否后台运行 MaxCount int //循环重启最大次数, 若为0则无限重启 MainPidFile string //主进程PID文件 DaemonPidFile string //守护进程PID文件 ServerName string //进程名称 // contains filtered or unexported fields }
func (*Manager) DaemonProcessIsRunning ¶
判断守护进程是否运行中
func (*Manager) MainProcessIsRunning ¶
判断主进程是否运行中
Source Files
¶
Click to show internal directories.
Click to hide internal directories.