Documentation ¶
Index ¶
- Constants
- func ListProcess(text string) (lines []string, err error)
- func NewProcessDaemon(newCmdFn func() *exec.Cmd, opts ...DaemonOption) (d interfaces.ProcessDaemon)
- func ProcessIdExists(id int) (ok bool)
- type Daemon
- func (d *Daemon) GetCh() (ch chan int)
- func (d *Daemon) GetCmd() (cmd *exec.Cmd)
- func (d *Daemon) GetExitTimeout() (timeout time.Duration)
- func (d *Daemon) GetMaxErrors() (maxErrors int)
- func (d *Daemon) SetExitTimeout(timeout time.Duration)
- func (d *Daemon) SetMaxErrors(maxErrors int)
- func (d *Daemon) Start() (err error)
- func (d *Daemon) Stop()
- type DaemonOption
Constants ¶
View Source
const ( SignalCreate = iota SignalStart SignalStopped SignalError SignalExited SignalReachedMaxErrors )
Variables ¶
This section is empty.
Functions ¶
func ListProcess ¶
func NewProcessDaemon ¶
func NewProcessDaemon(newCmdFn func() *exec.Cmd, opts ...DaemonOption) (d interfaces.ProcessDaemon)
func ProcessIdExists ¶
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
func (*Daemon) GetExitTimeout ¶
func (*Daemon) GetMaxErrors ¶
func (*Daemon) SetExitTimeout ¶
func (*Daemon) SetMaxErrors ¶
type DaemonOption ¶
type DaemonOption func(d interfaces.ProcessDaemon)
func WithDaemonMaxErrors ¶
func WithDaemonMaxErrors(maxErrors int) DaemonOption
func WithExitTimeout ¶
func WithExitTimeout(timeout time.Duration) DaemonOption
Click to show internal directories.
Click to hide internal directories.