Documentation ¶
Overview ¶
Package process is a generated protocol buffer package.
It is generated from these files:
process_info.proto
It has these top-level messages:
ProcessInfo ProcessInfoMap
Index ¶
- Constants
- Variables
- func GoID() int
- func Path_expand(path string) (string, error)
- type PROCESSPID
- type ProcAction
- type Process
- func (p *Process) GetDescription() string
- func (p *Process) GetExitstatus() int
- func (p *Process) GetGroup() string
- 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) ProcessInfo() ProcessInfo
- func (p *Process) SendProcessStdin(chars string) error
- func (p *Process) SetKillAttr(startKill, exitKill bool)
- func (p *Process) Signal(sig os.Signal, sigChildren bool) error
- func (p *Process) Start(wait bool, updateCb func(*Process))
- func (p *Process) Stop(wait bool)
- func (p *Process) TypeProcessInfo() types.ProcessInfo
- type ProcessInfo
- func (p *ProcessInfo) CheckAlive() bool
- func (p *ProcessInfo) ConfigEntry() *config.ConfigEntry
- func (*ProcessInfo) Descriptor() ([]byte, []int)
- func (this *ProcessInfo) Equal(that interface{}) bool
- func (this *ProcessInfo) GoString() string
- func (p *ProcessInfo) IsFrozen() bool
- func (m *ProcessInfo) Marshal() (dAtA []byte, err error)
- func (m *ProcessInfo) MarshalTo(dAtA []byte) (int, error)
- func (*ProcessInfo) ProtoMessage()
- func (m *ProcessInfo) Reset()
- func (m *ProcessInfo) Size() (n int)
- func (p *ProcessInfo) Stop(wait bool)
- func (this *ProcessInfo) String() string
- func (p *ProcessInfo) TypeProcessInfo() types.ProcessInfo
- func (m *ProcessInfo) Unmarshal(dAtA []byte) error
- func (this *ProcessInfo) Validate() error
- func (this *ProcessInfo) VerboseEqual(that interface{}) error
- func (m *ProcessInfo) XXX_DiscardUnknown()
- func (m *ProcessInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ProcessInfo) XXX_Merge(src proto.Message)
- func (m *ProcessInfo) XXX_Size() int
- func (m *ProcessInfo) XXX_Unmarshal(b []byte) error
- type ProcessInfoMap
- func (*ProcessInfoMap) Descriptor() ([]byte, []int)
- func (this *ProcessInfoMap) Equal(that interface{}) bool
- func (m *ProcessInfoMap) GetProcessInfo(program string) (ProcessInfo, bool)
- func (this *ProcessInfoMap) GoString() string
- func (m *ProcessInfoMap) Marshal() (dAtA []byte, err error)
- func (m *ProcessInfoMap) MarshalTo(dAtA []byte) (int, error)
- func (*ProcessInfoMap) ProtoMessage()
- func (m *ProcessInfoMap) Reset()
- func (m *ProcessInfoMap) Size() (n int)
- func (this *ProcessInfoMap) String() string
- func (m *ProcessInfoMap) Unmarshal(dAtA []byte) error
- func (this *ProcessInfoMap) Validate() error
- func (this *ProcessInfoMap) VerboseEqual(that interface{}) error
- func (m *ProcessInfoMap) XXX_DiscardUnknown()
- func (m *ProcessInfoMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ProcessInfoMap) XXX_Merge(src proto.Message)
- func (m *ProcessInfoMap) XXX_Size() int
- func (m *ProcessInfoMap) XXX_Unmarshal(b []byte) error
- type ProcessManager
- func (pm *ProcessManager) AddProc(proc *Process)
- func (pm *ProcessManager) Clear()
- func (pm *ProcessManager) CreateProcess(supervisor_id string, config *config.ConfigEntry) *Process
- func (pm *ProcessManager) Find(name string) *Process
- func (pm *ProcessManager) FindMatch(name string) []*Process
- func (pm *ProcessManager) FindProcessInfo(name string) *ProcessInfo
- func (pm *ProcessManager) ForEachProcess(procFunc func(p *Process))
- func (pm *ProcessManager) GetActivePrestartProcess() (int, []ProcessInfo)
- func (pm *ProcessManager) GetAllInfomapProcess() (int, []ProcessInfo)
- func (pm *ProcessManager) GetDeadPrestartProcess() (int, []string)
- func (pm *ProcessManager) GetFrozenPrestartProcess() (int, []ProcessInfo)
- func (pm *ProcessManager) GetPrestartProcess() (int, []ProcessInfo)
- func (pm *ProcessManager) GetProcsProcessInfo(name string) *Process
- func (pm *ProcessManager) KillAllProcesses(procFunc func(ProcessInfo))
- func (pm *ProcessManager) OutputInfomap()
- func (pm *ProcessManager) Remove(name string) *Process
- func (pm *ProcessManager) RemoveAllProcesses(procFunc func(ProcessInfo))
- func (pm *ProcessManager) RemoveProcessInfo(name string) ProcessInfo
- func (pm *ProcessManager) RemoveProcessInfoFile()
- func (pm *ProcessManager) StartAutoStartPrograms()
- func (pm *ProcessManager) StopAllProcesses(start bool, exit bool)
- func (pm *ProcessManager) StopProcess(name string, wait bool) *Process
- func (pm *ProcessManager) StopProcessInfo(name string, wait bool) *ProcessInfo
- func (pm *ProcessManager) UpdateConfig(config *config.ConfigEntry)
- func (pm *ProcessManager) UpdateProcessInfo(proc *Process)
- func (pm *ProcessManager) ValidateStartPs() ([]string, []string)
- type ProcessState
Constants ¶
View Source
const ( STOPPED ProcessState = iota STARTING = 10 RUNNING = 20 BACKOFF = 30 STOPPING = 40 EXITED = 100 FATAL = 200 UNKNOWN = 1000 )
Variables ¶
View Source
var ( ErrInvalidLengthProcessInfo = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowProcessInfo = fmt.Errorf("proto: integer overflow") )
View Source
var PROCESSPID_name = map[int32]string{
0: "FROZEN_PID",
}
View Source
var PROCESSPID_value = map[string]int32{
"FROZEN_PID": 0,
}
View Source
var ProcAction_name = map[int32]string{
0: "PA_UNKNOWN",
1: "PA_ADD",
2: "PA_DELETE",
3: "PA_NOOP",
}
View Source
var ProcAction_value = map[string]int32{
"PA_UNKNOWN": 0,
"PA_ADD": 1,
"PA_DELETE": 2,
"PA_NOOP": 3,
}
Functions ¶
func Path_expand ¶
Types ¶
type PROCESSPID ¶
type PROCESSPID int32
const (
FROZEN_PID PROCESSPID = 0
)
func (PROCESSPID) Enum ¶
func (x PROCESSPID) Enum() *PROCESSPID
func (PROCESSPID) EnumDescriptor ¶
func (PROCESSPID) EnumDescriptor() ([]byte, []int)
func (PROCESSPID) MarshalJSON ¶
func (x PROCESSPID) MarshalJSON() ([]byte, error)
func (PROCESSPID) String ¶
func (x PROCESSPID) String() string
func (*PROCESSPID) UnmarshalJSON ¶
func (x *PROCESSPID) UnmarshalJSON(data []byte) error
type ProcAction ¶
type ProcAction int32
const ( PA_UNKNOWN ProcAction = 0 PA_ADD ProcAction = 1 PA_DELETE ProcAction = 2 PA_NOOP ProcAction = 3 )
func (ProcAction) Enum ¶
func (x ProcAction) Enum() *ProcAction
func (ProcAction) EnumDescriptor ¶
func (ProcAction) EnumDescriptor() ([]byte, []int)
func (ProcAction) MarshalJSON ¶
func (x ProcAction) MarshalJSON() ([]byte, error)
func (ProcAction) String ¶
func (x ProcAction) String() string
func (*ProcAction) UnmarshalJSON ¶
func (x *ProcAction) UnmarshalJSON(data []byte) error
type Process ¶
type Process struct { StdoutLog logger.Logger StderrLog logger.Logger // contains filtered or unexported fields }
func NewProcess ¶
func NewProcess(supervisor_id string, config *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) ProcessInfo ¶
func (p *Process) ProcessInfo() ProcessInfo
func (*Process) SendProcessStdin ¶
func (*Process) SetKillAttr ¶
func (*Process) Signal ¶
send signal to the process
Args:
sig - the signal to the process sigChildren - true: send the signal to the process and its children proess
func (*Process) TypeProcessInfo ¶
func (p *Process) TypeProcessInfo() types.ProcessInfo
type ProcessInfo ¶
type ProcessInfo struct { // @inject_tag: yaml:"start_time" StartTime uint64 `protobuf:"varint,1,opt,name=StartTime" json:"StartTime" yaml:"start_time"` // @inject_tag: yaml:"pid" // 如果 PID 为 FROZEN_PID,则说明进程是 supervisord 杀掉的 PID int64 `protobuf:"varint,3,opt,name=PID" json:"PID" yaml:"pid"` // @inject_tag: yaml:"program" Program string `protobuf:"bytes,4,opt,name=Program" json:"Program" yaml:"program"` // contains filtered or unexported fields }
func (*ProcessInfo) CheckAlive ¶
func (p *ProcessInfo) CheckAlive() bool
func (*ProcessInfo) ConfigEntry ¶
func (p *ProcessInfo) ConfigEntry() *config.ConfigEntry
func (*ProcessInfo) Descriptor ¶
func (*ProcessInfo) Descriptor() ([]byte, []int)
func (*ProcessInfo) Equal ¶
func (this *ProcessInfo) Equal(that interface{}) bool
func (*ProcessInfo) GoString ¶
func (this *ProcessInfo) GoString() string
func (*ProcessInfo) IsFrozen ¶
func (p *ProcessInfo) IsFrozen() bool
func (*ProcessInfo) Marshal ¶
func (m *ProcessInfo) Marshal() (dAtA []byte, err error)
func (*ProcessInfo) ProtoMessage ¶
func (*ProcessInfo) ProtoMessage()
func (*ProcessInfo) Reset ¶
func (m *ProcessInfo) Reset()
func (*ProcessInfo) Size ¶
func (m *ProcessInfo) Size() (n int)
func (*ProcessInfo) String ¶
func (this *ProcessInfo) String() string
func (*ProcessInfo) TypeProcessInfo ¶
func (p *ProcessInfo) TypeProcessInfo() types.ProcessInfo
func (*ProcessInfo) Unmarshal ¶
func (m *ProcessInfo) Unmarshal(dAtA []byte) error
func (*ProcessInfo) Validate ¶
func (this *ProcessInfo) Validate() error
func (*ProcessInfo) VerboseEqual ¶
func (this *ProcessInfo) VerboseEqual(that interface{}) error
func (*ProcessInfo) XXX_DiscardUnknown ¶
func (m *ProcessInfo) XXX_DiscardUnknown()
func (*ProcessInfo) XXX_Marshal ¶
func (m *ProcessInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcessInfo) XXX_Merge ¶
func (dst *ProcessInfo) XXX_Merge(src proto.Message)
func (*ProcessInfo) XXX_Size ¶
func (m *ProcessInfo) XXX_Size() int
func (*ProcessInfo) XXX_Unmarshal ¶
func (m *ProcessInfo) XXX_Unmarshal(b []byte) error
type ProcessInfoMap ¶
type ProcessInfoMap struct { // @inject_tag: yaml:"version" Version uint64 `protobuf:"varint,1,opt,name=Version" json:"Version" yaml:"version"` // @inject_tag: yaml:"info_map" InfoMap map[string]ProcessInfo `` /* 140-byte string literal not displayed */ // contains filtered or unexported fields }
func NewProcessInfoMap ¶
func NewProcessInfoMap() *ProcessInfoMap
func (*ProcessInfoMap) Descriptor ¶
func (*ProcessInfoMap) Descriptor() ([]byte, []int)
func (*ProcessInfoMap) Equal ¶
func (this *ProcessInfoMap) Equal(that interface{}) bool
func (*ProcessInfoMap) GetProcessInfo ¶
func (m *ProcessInfoMap) GetProcessInfo(program string) (ProcessInfo, bool)
func (*ProcessInfoMap) GoString ¶
func (this *ProcessInfoMap) GoString() string
func (*ProcessInfoMap) Marshal ¶
func (m *ProcessInfoMap) Marshal() (dAtA []byte, err error)
func (*ProcessInfoMap) ProtoMessage ¶
func (*ProcessInfoMap) ProtoMessage()
func (*ProcessInfoMap) Reset ¶
func (m *ProcessInfoMap) Reset()
func (*ProcessInfoMap) Size ¶
func (m *ProcessInfoMap) Size() (n int)
func (*ProcessInfoMap) String ¶
func (this *ProcessInfoMap) String() string
func (*ProcessInfoMap) Unmarshal ¶
func (m *ProcessInfoMap) Unmarshal(dAtA []byte) error
func (*ProcessInfoMap) Validate ¶
func (this *ProcessInfoMap) Validate() error
func (*ProcessInfoMap) VerboseEqual ¶
func (this *ProcessInfoMap) VerboseEqual(that interface{}) error
func (*ProcessInfoMap) XXX_DiscardUnknown ¶
func (m *ProcessInfoMap) XXX_DiscardUnknown()
func (*ProcessInfoMap) XXX_Marshal ¶
func (m *ProcessInfoMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcessInfoMap) XXX_Merge ¶
func (dst *ProcessInfoMap) XXX_Merge(src proto.Message)
func (*ProcessInfoMap) XXX_Size ¶
func (m *ProcessInfoMap) XXX_Size() int
func (*ProcessInfoMap) XXX_Unmarshal ¶
func (m *ProcessInfoMap) XXX_Unmarshal(b []byte) error
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
func NewProcessManager ¶
func NewProcessManager() *ProcessManager
func (*ProcessManager) AddProc ¶
func (pm *ProcessManager) AddProc(proc *Process)
func (*ProcessManager) CreateProcess ¶
func (pm *ProcessManager) CreateProcess(supervisor_id string, config *config.ConfigEntry) *Process
func (*ProcessManager) Find ¶
func (pm *ProcessManager) Find(name string) *Process
return process if found or nil if not found
func (*ProcessManager) FindMatch ¶
func (pm *ProcessManager) FindMatch(name string) []*Process
func (*ProcessManager) FindProcessInfo ¶
func (pm *ProcessManager) FindProcessInfo(name string) *ProcessInfo
func (*ProcessManager) ForEachProcess ¶
func (pm *ProcessManager) ForEachProcess(procFunc func(p *Process))
func (*ProcessManager) GetActivePrestartProcess ¶
func (pm *ProcessManager) GetActivePrestartProcess() (int, []ProcessInfo)
the return value list: the first is prestart process number the second is the active prestart process name array
func (*ProcessManager) GetAllInfomapProcess ¶
func (pm *ProcessManager) GetAllInfomapProcess() (int, []ProcessInfo)
用于 status _infomap
func (*ProcessManager) GetDeadPrestartProcess ¶
func (pm *ProcessManager) GetDeadPrestartProcess() (int, []string)
the return value list: the first is prestart process number the second is the dead prestart process name array
func (*ProcessManager) GetFrozenPrestartProcess ¶
func (pm *ProcessManager) GetFrozenPrestartProcess() (int, []ProcessInfo)
func (*ProcessManager) GetPrestartProcess ¶
func (pm *ProcessManager) GetPrestartProcess() (int, []ProcessInfo)
func (*ProcessManager) GetProcsProcessInfo ¶
func (pm *ProcessManager) GetProcsProcessInfo(name string) *Process
return process if found or nil if not found
func (*ProcessManager) KillAllProcesses ¶
func (pm *ProcessManager) KillAllProcesses(procFunc func(ProcessInfo))
func (*ProcessManager) OutputInfomap ¶
func (pm *ProcessManager) OutputInfomap()
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) RemoveAllProcesses ¶
func (pm *ProcessManager) RemoveAllProcesses(procFunc func(ProcessInfo))
func (*ProcessManager) RemoveProcessInfo ¶
func (pm *ProcessManager) RemoveProcessInfo(name string) ProcessInfo
func (*ProcessManager) RemoveProcessInfoFile ¶
func (pm *ProcessManager) RemoveProcessInfoFile()
func (*ProcessManager) StartAutoStartPrograms ¶
func (pm *ProcessManager) StartAutoStartPrograms()
func (*ProcessManager) StopAllProcesses ¶
func (pm *ProcessManager) StopAllProcesses(start bool, exit bool)
func (*ProcessManager) StopProcess ¶
func (pm *ProcessManager) StopProcess(name string, wait bool) *Process
stop the process
Arguments: name - the name of program
Return the process or nil
func (*ProcessManager) StopProcessInfo ¶
func (pm *ProcessManager) StopProcessInfo(name string, wait bool) *ProcessInfo
func (*ProcessManager) UpdateConfig ¶
func (pm *ProcessManager) UpdateConfig(config *config.ConfigEntry)
func (*ProcessManager) UpdateProcessInfo ¶
func (pm *ProcessManager) UpdateProcessInfo(proc *Process)
func (*ProcessManager) ValidateStartPs ¶
func (pm *ProcessManager) ValidateStartPs() ([]string, []string)
type ProcessState ¶
type ProcessState int64
func (ProcessState) String ¶
func (p ProcessState) String() string
Click to show internal directories.
Click to hide internal directories.