Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { Start() error Run() error Terminate() Wait() error SetStdout(stdout io.Writer) SetStderr(stderr io.Writer) SetStdin(stdin io.Reader) StdoutPipe() (io.ReadCloser, error) StderrPipe() (io.ReadCloser, error) ExitCode() int }
Command is a wrapper to exec.Cmd. It handles context-cancellation cleanup and defines a String() method to make logging easier.
func NewCommand ¶
NewCommand creates a new command object that's tied to the passed-in context. When cmd.Start() is invoked, the command will run in its own process group. When the context is cancelled, a SIGTERM signal will be sent to the command's process group. If after five seconds the command's process has not been terminated, then a SIGKILL signal is sent to the command's process group.
type PluginSpec ¶
type PluginSpec struct {
Script string
}
PluginSpec represents an external plugin's specification.
func (PluginSpec) Load ¶
func (s PluginSpec) Load() (plugin.Root, error)
Load ensures the external plugin represents an executable artifact and create a plugin Root.
func (PluginSpec) Name ¶
func (s PluginSpec) Name() string
Name returns the plugin name, which is the basename of the script with extension removed.