Documentation
¶
Overview ¶
Package process has helper code for managing server processes and connections to them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartOnDevice ¶ added in v1.2.0
StartOnDevice runs the application on the given remote device, with the given path and options, waits for the "Bound on port {port}" string to be printed to stdout, and then returns the port number.
Types ¶
type PortWatcher ¶ added in v1.2.0
type PortWatcher struct {
// contains filtered or unexported fields
}
PortWatcher will wait for the given port to become available on the given device. It will look at the given stdout, for the lines Bound on port <portnum>, and in the given portFile for the same lines. If either is found, the port will be written to portChan. Otherwise an error will be written to the channel.
func NewPortWatcher ¶ added in v1.2.0
func NewPortWatcher(portChan chan<- string, opts *StartOptions) *PortWatcher
NewPortWatcher creates and returns an initialized port watcher
func (*PortWatcher) WaitForFile ¶ added in v1.2.0
func (w *PortWatcher) WaitForFile(ctx context.Context)
Waits until the port file is found, or the context is cancelled
type StartOptions ¶
type StartOptions struct { // Command line arguments for starting the process. Args []string // Environment variables for starting the process. Env *shell.Env // Standard output pipe for the new process. Stdout io.Writer // Standard error pipe for the new process. Stderr io.Writer // Should all stderr and and stdout also be logged to the logger? Verbose bool // PortFile, if not "", is a file that can be search if we can // not find the output on stdout PortFile string // If not "", the working directory for this command WorkingDir string // Device, which device should this be started on Device bind.Device }
StartOptions holds the options that can be passed to Start.