Documentation
¶
Index ¶
- Constants
- func AddDefaultVars(vars map[string]string) map[string]string
- func ReplaceVars(text string, vars map[string]string) string
- type Event
- type FileLogWriter
- type InMemoryLogWriter
- type LogWriter
- type Proc
- type ProcMgr
- type ProcRun
- type Process
- func (p *Process) Active() ProcRun
- func (p *Process) GetProcID() string
- func (p *Process) GetSvcName() string
- func (p *Process) HoldProcRun(pr ProcRun)
- func (p *Process) IsActive() bool
- func (p *Process) NewProcessRun(endpoints map[string]string) ProcRun
- func (p *Process) NumOfProcRuns() int
- func (p *Process) ProcRuns() []ProcRun
- func (p *Process) SetActive(pr ProcRun)
- func (p *Process) SetInactive()
- func (p *Process) Start(endpoints map[string]string) error
- func (p *Process) State() ProcessState
- func (p *Process) Stop() error
- type ProcessRun
- type ProcessRunInfo
- type ProcessState
- type ProcessStatus
Constants ¶
View Source
const ( StateStarted = ProcessState("StateStarted") StateStopped = ProcessState("StateStopped") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileLogWriter ¶
type FileLogWriter struct {
// contains filtered or unexported fields
}
func NewFileLogWriter ¶
func NewFileLogWriter(file string) (*FileLogWriter, error)
func (FileLogWriter) Close ¶
func (flw FileLogWriter) Close()
func (FileLogWriter) Len ¶
func (flw FileLogWriter) Len() int64
func (FileLogWriter) String ¶
func (flw FileLogWriter) String() string
type InMemoryLogWriter ¶
type InMemoryLogWriter struct {
// contains filtered or unexported fields
}
func NewInMemoryLogWriter ¶
func NewInMemoryLogWriter() InMemoryLogWriter
func (InMemoryLogWriter) Close ¶
func (imlw InMemoryLogWriter) Close()
func (InMemoryLogWriter) Len ¶
func (imlw InMemoryLogWriter) Len() int64
func (InMemoryLogWriter) String ¶
func (imlw InMemoryLogWriter) String() string
type Proc ¶
type ProcMgr ¶
type ProcMgr interface { CreateProcess(*ProcessStatus, map[string]string) (Proc, error) DestroyProcess(string) error StartProcess(string, map[string]string) error StopProcess(string) error AllProcess() map[string]Proc AllActiveProcess() map[string]Proc TotalProcess() int TotalActiveProcess() int FindByProcID(string) Proc FindBySvcName(string) map[string]Proc }
func NewProcessManager ¶
func NewProcessManager() ProcMgr
type Process ¶
type Process struct { ProcID string SvcName string Executor []string Command string Args []string StdoutFile string StderrFile string Environment map[string]string Metadata map[string]string Pwd string // contains filtered or unexported fields }
func (*Process) GetSvcName ¶
func (*Process) HoldProcRun ¶
func (*Process) NewProcessRun ¶
func (*Process) NumOfProcRuns ¶
func (*Process) SetInactive ¶
func (p *Process) SetInactive()
func (*Process) State ¶
func (p *Process) State() ProcessState
type ProcessRun ¶
type ProcessRun struct { ID int Commandline string Cmd *exec.Cmd Error error Started time.Time Stopped time.Time Events []*Event ProcID string SvcName string StdoutFile string StderrFile string StdoutBuf LogWriter StderrBuf LogWriter Environment map[string]string WaitStatus syscall.WaitStatus Pwd string Stopc chan struct{} }
func (*ProcessRun) Kill ¶
func (pr *ProcessRun) Kill() error
func (*ProcessRun) Start ¶
func (pr *ProcessRun) Start() error
func (*ProcessRun) String ¶
func (pr *ProcessRun) String() string
func (*ProcessRun) WaitingStopped ¶
func (pr *ProcessRun) WaitingStopped()
func (*ProcessRun) WaitingStoppedInMillisecond ¶
func (pr *ProcessRun) WaitingStoppedInMillisecond(timeout time.Duration) bool
type ProcessRunInfo ¶
type ProcessState ¶
type ProcessState string
func (ProcessState) Opposite ¶
func (s ProcessState) Opposite() ProcessState
func (ProcessState) String ¶
func (s ProcessState) String() string
type ProcessStatus ¶
type ProcessStatus struct { ProcID string SvcName string MachID string DesiredState ProcessState CurrentState ProcessState IsAlive bool RunInfo ProcessRunInfo }
Click to show internal directories.
Click to hide internal directories.