Documentation
¶
Index ¶
- type Command
- type History
- type Listener
- type Option
- func WithEnvironment(env map[string]string) Option
- func WithFlashIntervalMs(ts int) Option
- func WithHistory(history *History) Option
- func WithListener(listener Listener) Option
- func WithPath(aPath string) Option
- func WithRunner(runner Runner) Option
- func WithShell(shell string) Option
- func WithShellPrompt(shellPrompt string) Option
- func WithSystemPaths(paths []string) Option
- func WithTerminators(terminators []string) Option
- func WithTimeout(timeoutMs int) Option
- type Options
- type Pipeline
- func (p *Pipeline) Close() (err error)
- func (p *Pipeline) Drain(ctx context.Context, opts ...Option)
- func (p *Pipeline) Err() error
- func (p *Pipeline) FormatCmd(cmd string) string
- func (p *Pipeline) Read(ctx context.Context, opts ...Option) (output string, has bool, code int, err error)
- func (p *Pipeline) Running() bool
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
Listener represent command listener (it will send stdout fragments as thier being available on stdout)
type Option ¶
type Option func(*Options)
Option represents runner option
func WithEnvironment ¶
WithEnvironment creates with environment option
func WithFlashIntervalMs ¶
WithFlashIntervalMs creates with flash time option
func WithHistory ¶
WithHistory creates with history option
func WithListener ¶
WithListener creates with listener option
func WithShellPrompt ¶
WithShellPrompt creates with shell prompt option
func WithSystemPaths ¶
WithSystemPaths creates with listener option
func WithTerminators ¶
WithTerminators creates with terminators option
type Options ¶
type Options struct {
Runner Runner
Shell string
Term string
Cols int
Rows int
Path string
Env map[string]string
SystemPaths []string
History *History
// contains filtered or unexported fields
}
Options represents runner options
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline represents a command pipeline
func NewPipeline ¶
func NewPipeline(ctx context.Context, in io.WriteCloser, stdout io.Reader, stderr io.Reader, options *Options) (*Pipeline, error)
NewPipeline creates a new pipeline
type Runner ¶
type Runner interface {
//Run runs supplied command
Run(ctx context.Context, command string, options ...Option) (string, int, error)
//Stdin returns stdin writer
Stdin() io.Writer
//PID returns process id
PID() int
//Close closes runner
Close() error
}
Runner represents a command runner
Source Files
¶
Click to show internal directories.
Click to hide internal directories.