Documentation ¶
Overview ¶
Package funrun provides a simple way to run multiple processes in a single process group.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
func NewCommand ¶
func (*Command) SetOutputs ¶
func (c *Command) SetOutputs(wout, werr *PrefixWriter)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) SetOutputs ¶
type PrefixWriter ¶
func NewPrefixWriter ¶
func NewPrefixWriter(name, outType string, nameWidth, color int, write io.Writer) *PrefixWriter
func (*PrefixWriter) Close ¶
func (w *PrefixWriter) Close() error
func (*PrefixWriter) Logln ¶
func (w *PrefixWriter) Logln(s string) error
type ProcConf ¶
type ProcConf struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` // Name of the process Cmd string `json:"cmd,omitempty" yaml:"cmd,omitempty"` // Command to run (required unless Cmds is set) Cmds []string `json:"cmds,omitempty" yaml:"cmds,omitempty"` // Command to run (required unless Cmd is set) Args []string `json:"args,omitempty" yaml:"args,omitempty"` // Arguments to pass to the command Envs map[string]string `json:"envs,omitempty" yaml:"envs,omitempty"` // Environment variables to set Restart RestartPolicy `json:"restart,omitempty" yaml:"restart,omitempty"` // Restart policy for the command WorkDir string `json:"workdir,omitempty" yaml:"workdir,omitempty"` // Working directory for the command ClearEnvs bool `json:"clear_envs,omitempty" yaml:"clear_envs,omitempty"` // Clear all environment variables before setting the ones in Envs Timeout time.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"` // Timeout for the command }
type RestartPolicy ¶
type RestartPolicy string
RestartPolicy represents the restart behavior of a process.
const ( RestartNever RestartPolicy = "never" // Never restart the process RestartOnFail RestartPolicy = "on-fail" // Restart the process if it exits with a non-zero exit code RestartAlways RestartPolicy = "always" // Always restart the process )
Click to show internal directories.
Click to hide internal directories.