Documentation ¶
Index ¶
- Constants
- func Path_expand(path string) (string, error)
- type ConfigEntry
- func (c *ConfigEntry) GetArgs() []string
- func (c *ConfigEntry) GetBool(key string, defValue bool) bool
- func (c *ConfigEntry) GetBytes(key string, defValue int) int
- func (c *ConfigEntry) GetEnv() []string
- func (c *ConfigEntry) GetInt(key string, defValue int) int
- func (c *ConfigEntry) GetString(key string, defValue string) string
- func (c *ConfigEntry) GetStringArray(key string, sep string) []string
- func (c *ConfigEntry) HasParameter(key string) bool
- func (c *ConfigEntry) String() string
- type Process
- func (p *Process) Attach() error
- func (p *Process) GetDescription() string
- func (p *Process) GetExitstatus() int
- func (p *Process) GetName() string
- func (p *Process) GetPid() int
- func (p *Process) GetPriority() int
- func (p *Process) GetStartTime() time.Time
- func (p *Process) GetState() ProcessState
- func (p *Process) GetStatus() string
- func (p *Process) GetStderrLogfile() string
- func (p *Process) GetStdoutLogfile() string
- func (p *Process) GetStopTime() time.Time
- func (p *Process) SendProcessStdin(chars string) error
- func (p *Process) Signal(sig os.Signal) error
- func (p *Process) Start(wait bool)
- func (p *Process) Stop(wait bool)
- type ProcessManager
- func (pm *ProcessManager) Add(name string, proc *Process)
- func (pm *ProcessManager) Clear()
- func (pm *ProcessManager) CreateProcess(config *ConfigEntry) *Process
- func (pm *ProcessManager) Find(name string) *Process
- func (pm *ProcessManager) ForEachProcess(procFunc func(p *Process))
- func (pm *ProcessManager) Remove(name string) *Process
- func (pm *ProcessManager) StartAutoStartPrograms()
- func (pm *ProcessManager) StopAllProcesses()
- type ProcessState
Constants ¶
View Source
const ( STOPPED ProcessState = iota STARTING = 10 RUNNING = 20 BACKOFF = 30 STOPPING = 40 EXITED = 100 FATAL = 200 UNKNOWN = 1000 )
Variables ¶
This section is empty.
Functions ¶
func Path_expand ¶
Types ¶
type ConfigEntry ¶
type ConfigEntry struct { ConfigDir string Name string Arguments []string KeyValues map[string]string Envs map[string]string }
func (*ConfigEntry) GetArgs ¶
func (c *ConfigEntry) GetArgs() []string
func (*ConfigEntry) GetBool ¶
func (c *ConfigEntry) GetBool(key string, defValue bool) bool
get value of key as bool
func (*ConfigEntry) GetBytes ¶
func (c *ConfigEntry) GetBytes(key string, defValue int) int
get the value of key as the bytes setting.
logSize=1MB logSize=1GB logSize=1KB logSize=1024
func (*ConfigEntry) GetEnv ¶
func (c *ConfigEntry) GetEnv() []string
func (*ConfigEntry) GetInt ¶
func (c *ConfigEntry) GetInt(key string, defValue int) int
get the value of the key as int
func (*ConfigEntry) GetString ¶
func (c *ConfigEntry) GetString(key string, defValue string) string
get the value of key as string
func (*ConfigEntry) GetStringArray ¶
func (c *ConfigEntry) GetStringArray(key string, sep string) []string
func (*ConfigEntry) HasParameter ¶
func (c *ConfigEntry) HasParameter(key string) bool
check if has parameter
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
func NewProcess ¶
func NewProcess(config *ConfigEntry) *Process
func (*Process) GetDescription ¶
func (*Process) GetExitstatus ¶
func (*Process) GetPriority ¶
func (*Process) GetStartTime ¶
func (*Process) GetStderrLogfile ¶
func (*Process) GetStdoutLogfile ¶
func (*Process) GetStopTime ¶
func (*Process) SendProcessStdin ¶
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
func NewProcessManager ¶
func NewProcessManager() *ProcessManager
func (*ProcessManager) Add ¶
func (pm *ProcessManager) Add(name string, proc *Process)
func (*ProcessManager) CreateProcess ¶
func (pm *ProcessManager) CreateProcess(config *ConfigEntry) *Process
func (*ProcessManager) Find ¶
func (pm *ProcessManager) Find(name string) *Process
return process if found or nil if not found
func (*ProcessManager) ForEachProcess ¶
func (pm *ProcessManager) ForEachProcess(procFunc func(p *Process))
func (*ProcessManager) Remove ¶
func (pm *ProcessManager) Remove(name string) *Process
remove the process from the manager
Arguments: name - the name of program
Return the process or nil
func (*ProcessManager) StartAutoStartPrograms ¶
func (pm *ProcessManager) StartAutoStartPrograms()
func (*ProcessManager) StopAllProcesses ¶
func (pm *ProcessManager) StopAllProcesses()
type ProcessState ¶
type ProcessState int
func (ProcessState) String ¶
func (p ProcessState) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.