Documentation ¶
Index ¶
- func PumpLines(inlet PumpSource, sink chan<- string, onDone *sync.WaitGroup, ...)
- func PumpPrefixedChannel(prefix string, source <-chan string, onDone *sync.WaitGroup)
- type GivePumpSource
- type Option
- type ProcGroup
- type PumpSource
- type Subcommand
- func (s *Subcommand) Interact(stdin <-chan string, stdout chan<- string, stderr chan<- string) error
- func (s *Subcommand) Kill() error
- func (s *Subcommand) PumpToStandard(title string) error
- func (s *Subcommand) Run(stdout chan<- string, stderr chan<- string) error
- func (s *Subcommand) SendSignal(signal os.Signal) error
- func (s *Subcommand) WithOption(opt Option)
- type WorkingDir
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GivePumpSource ¶
type GivePumpSource struct {
Source io.ReadCloser
}
func (*GivePumpSource) ObtainSource ¶
func (g *GivePumpSource) ObtainSource() (io.ReadCloser, error)
type ProcGroup ¶
type ProcGroup struct {
// contains filtered or unexported fields
}
ProcGroup is an option to launch a command in a process group. Provides the capability to send signals to the entire process group, as well as convince wrappers around the group.
func WithProcGroup ¶
func WithProcGroup() *ProcGroup
type PumpSource ¶
type PumpSource interface {
ObtainSource() (io.ReadCloser, error)
}
func FromCmdStderr ¶
func FromCmdStderr(cmd *exec.Cmd) PumpSource
func FromCmdStdout ¶
func FromCmdStdout(cmd *exec.Cmd) PumpSource
type Subcommand ¶
type Subcommand struct { Options []Option // contains filtered or unexported fields }
func NewSubcommand ¶
func NewSubcommand(programName string, args []string) *Subcommand
func (*Subcommand) Interact ¶
func (s *Subcommand) Interact(stdin <-chan string, stdout chan<- string, stderr chan<- string) error
func (*Subcommand) Kill ¶
func (s *Subcommand) Kill() error
Kill attempts to terminate the subcommand by sending an operating system kill signal.
NOTE: In the case of process cleanup this risks orphaning processes. Use `WithProcGroup` option and `Kill` with that instead.
func (*Subcommand) PumpToStandard ¶
func (s *Subcommand) PumpToStandard(title string) error
PumpToStandard will run the given command
func (*Subcommand) SendSignal ¶
func (s *Subcommand) SendSignal(signal os.Signal) error
func (*Subcommand) WithOption ¶
func (s *Subcommand) WithOption(opt Option)
type WorkingDir ¶
type WorkingDir struct {
Where string
}
func (*WorkingDir) Customize ¶
func (w *WorkingDir) Customize(cmd *exec.Cmd)
Click to show internal directories.
Click to hide internal directories.