Documentation
¶
Index ¶
- func KillProcessGroup(cmd *exec.Cmd)
- type LogEntry
- type ProcessStatus
- type Shell
- type State
- type Supervisor
- func (s *Supervisor) Build(name string, steps []string, 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) SetShell(shell string)
- 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
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 Shell ¶ added in v1.7.0
Shell is the interpreter used to run a process's cmd and build steps. It also knows how to chain multiple build steps into a single command line so that shell state (like a `cd`) persists from one step to the next — each Shell.Command invocation is one interpreter process, so chaining only works within a single invocation, never across separate ones.
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
Build runs the ordered build steps for the named process, chained into a single shell invocation so that shell state (like a `cd`) carries from one step to the next. Log output is written to the process's invincible log stream. If ctx is cancelled, the build is killed and the state reverts to its previous value.
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) SetShell ¶ added in v1.7.0
func (s *Supervisor) SetShell(shell string)
SetShell sets the interpreter used to run process and build commands. shell is a project.shell config value: "auto", "cmd", "bash", or "pwsh". Must be called before any process is started.
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()