process

package
v0.6.0-3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignalCreate = iota
	SignalStart
	SignalStopped
	SignalError
	SignalExited
	SignalReachedMaxErrors
)

Variables

This section is empty.

Functions

func ListProcess

func ListProcess(text string) (lines []string, err error)

func NewProcessDaemon

func NewProcessDaemon(newCmdFn func() *exec.Cmd, opts ...DaemonOption) (d interfaces.ProcessDaemon)

func ProcessIdExists

func ProcessIdExists(id int) (ok bool)

Types

type Daemon

type Daemon struct {
	// contains filtered or unexported fields
}

func (*Daemon) GetCh

func (d *Daemon) GetCh() (ch chan int)

func (*Daemon) GetCmd

func (d *Daemon) GetCmd() (cmd *exec.Cmd)

func (*Daemon) GetExitTimeout

func (d *Daemon) GetExitTimeout() (timeout time.Duration)

func (*Daemon) GetMaxErrors

func (d *Daemon) GetMaxErrors() (maxErrors int)

func (*Daemon) SetExitTimeout

func (d *Daemon) SetExitTimeout(timeout time.Duration)

func (*Daemon) SetMaxErrors

func (d *Daemon) SetMaxErrors(maxErrors int)

func (*Daemon) Start

func (d *Daemon) Start() (err error)

func (*Daemon) Stop

func (d *Daemon) Stop()

type DaemonOption

type DaemonOption func(d interfaces.ProcessDaemon)

func WithDaemonMaxErrors

func WithDaemonMaxErrors(maxErrors int) DaemonOption

func WithExitTimeout

func WithExitTimeout(timeout time.Duration) DaemonOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL