Documentation
¶
Index ¶
- func KillProcessGroup(cmd *exec.Cmd)
- func ShellCommand(cmdStr string) *exec.Cmd
- type LogEntry
- type ProcessStatus
- type State
- type Supervisor
- func (s *Supervisor) Build(name, buildCmd, cwd string, ctx context.Context) error
- func (s *Supervisor) Log(name, message string)
- func (s *Supervisor) Logs(name string, n int) []LogEntry
- func (s *Supervisor) Restart(name string) error
- func (s *Supervisor) RestartAll()
- func (s *Supervisor) Start(name string) error
- func (s *Supervisor) StartAll()
- func (s *Supervisor) Status() []ProcessStatus
- func (s *Supervisor) Stop(name string) error
- func (s *Supervisor) StopAll()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KillProcessGroup ¶ added in v1.4.0
func ShellCommand ¶ added in v1.4.0
Types ¶
type LogEntry ¶
type LogEntry struct {
Time time.Time `json:"time"`
Line string `json:"line"`
Source string `json:"source"`
}
LogEntry holds a single log line, its source, and when it was written. Source is "stdout", "stderr", or "invincible".
type ProcessStatus ¶
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfgs []config.ProcessConfig) *Supervisor
func (*Supervisor) Build ¶ added in v1.4.0
func (s *Supervisor) Build(name, buildCmd, cwd string, ctx context.Context) error
Build runs a build command for the named process. The process must be running. Log output is written to the process's invincible log stream. If ctx is cancelled, the build command is killed and the state reverts.
func (*Supervisor) Log ¶ added in v1.4.0
func (s *Supervisor) Log(name, message string)
Log writes a message to a process's invincible log stream.
func (*Supervisor) Restart ¶
func (s *Supervisor) Restart(name string) error
func (*Supervisor) RestartAll ¶
func (s *Supervisor) RestartAll()
RestartAll restarts every process in dependency order. Each level starts after the previous level has reached running.
func (*Supervisor) Start ¶
func (s *Supervisor) Start(name string) error
func (*Supervisor) StartAll ¶
func (s *Supervisor) StartAll()
func (*Supervisor) Status ¶
func (s *Supervisor) Status() []ProcessStatus
func (*Supervisor) Stop ¶
func (s *Supervisor) Stop(name string) error
func (*Supervisor) StopAll ¶
func (s *Supervisor) StopAll()
Click to show internal directories.
Click to hide internal directories.