Documentation ¶
Index ¶
- Constants
- Variables
- func ChildKeys() []string
- func IsRunning(name string) bool
- func NewLog(path string) *os.File
- func NewSysProcAttr() *syscall.SysProcAttr
- func Pid() int
- func RotateLog(logfile string, keepNum int) error
- func Run()
- func RunProcess(name string, p *Process) chan *Process
- func SetOption(options map[string]interface{}, name string, value interface{}) map[string]interface{}
- func Status() string
- func StopChild(name string) error
- type Children
- type Pidfile
- type Process
- func (p *Process) Add(name string, procs *Process, run ...bool) *Process
- func (p *Process) AddHook(status string, hooks ...func(procs *Process)) *Process
- func (p *Process) Child(name string) *Process
- func (p *Process) ChildKeys() []string
- func (p *Process) DailyRotate(keepNum int)
- func (p *Process) Error() error
- func (p *Process) Find() (*os.Process, string, error)
- func (p *Process) Init() *Process
- func (p *Process) IsRunning(name string) bool
- func (p *Process) LogKeepNum() int
- func (p *Process) Pid() int
- func (p *Process) Reset() error
- func (p *Process) Restart() (*Process, string)
- func (p *Process) RestartChild(name string) (*Process, error)
- func (p *Process) Rotate(keepNum int)
- func (p *Process) Run()
- func (p *Process) RunHook(status string)
- func (p *Process) SetAndTriggerStatus(status string)
- func (p *Process) SetChildKV(name string, proc *Process)
- func (p *Process) SetChildren(children map[string]*Process)
- func (p *Process) SetError(err error)
- func (p *Process) SetHook(status string, hooks ...func(procs *Process)) *Process
- func (p *Process) SetLogKeepNum(keepNum int)
- func (p *Process) SetStatus(status string, dontTriggerEvent ...bool)
- func (p *Process) SetX(x Processer)
- func (p *Process) Start(name string) string
- func (p *Process) StartChild(name string) (*Process, error)
- func (p *Process) StartProcess(name string, argv []string, attr *os.ProcAttr) (Processer, error)
- func (p *Process) Status() string
- func (p *Process) Stop() string
- func (p *Process) StopChild(name string) error
- func (p *Process) String() string
- func (p *Process) X() Processer
- type Processer
Constants ¶
View Source
const ( StatusStarted = `started` StatusRunning = `running` StatusStopped = `stopped` StatusRestarted = `restarted` StatusExited = `exited` StatusKilled = `killed` )
Variables ¶
View Source
var Default = New()
View Source
var ErrCouldNotFindProcess = errors.New("could not find process")
View Source
var ErrPidfileEmpty = errors.New("Pidfile is empty")
Functions ¶
func NewSysProcAttr ¶ added in v0.3.0
func NewSysProcAttr() *syscall.SysProcAttr
Types ¶
type Children ¶ added in v0.1.1
type Children struct {
// contains filtered or unexported fields
}
Children Child processes.
func NewChildren ¶ added in v0.3.0
type Process ¶
type Process struct { Name string Command string Env []string Dir string Args []string User string Pidfile Pidfile Logfile string Errfile string Respawn int Delay string Ping string Debug bool // Options // HideWindow bool // for windows Options map[string]interface{} `json:",omitempty" xml:",omitempty"` // contains filtered or unexported fields }
func NewProcess ¶ added in v0.1.1
func RestartChild ¶ added in v0.1.1
func StartChild ¶ added in v0.1.1
func (*Process) DailyRotate ¶ added in v0.3.1
func (*Process) LogKeepNum ¶ added in v0.3.1
func (*Process) RestartChild ¶ added in v0.1.1
func (*Process) SetAndTriggerStatus ¶ added in v0.2.5
func (*Process) SetChildKV ¶ added in v0.2.0
func (*Process) SetChildren ¶ added in v0.2.0
func (*Process) SetLogKeepNum ¶ added in v0.3.1
func (*Process) StartChild ¶ added in v0.1.1
func (*Process) StartProcess ¶ added in v0.2.5
Source Files ¶
Click to show internal directories.
Click to hide internal directories.