Documentation ¶
Index ¶
- type Builder
- func (b *Builder) InheritEnvs(v bool) *Builder
- func (b *Builder) Output(args ...interface{}) ([]byte, error)
- func (b *Builder) Prepare(args ...interface{}) error
- func (b *Builder) Start(args ...interface{}) error
- func (b *Builder) StartWithHandlers(stdinFunc func(io.Writer) error, stdoutFunc func(io.Reader) error, ...) error
- func (b *Builder) Stdin(f func(w io.Writer) error) error
- func (b *Builder) Stdout(w io.Writer)
- func (b *Builder) StdoutTo(next *Builder)
- func (b *Builder) Wait() error
- func (b *Builder) WithArg(key string, value interface{}) *Builder
- func (b *Builder) WithArgs(args ...interface{}) *Builder
- func (b *Builder) WithContext(context interface{}) *Builder
- func (b *Builder) WithDir(path string) *Builder
- func (b *Builder) WithEnvs(kv ...string) *Builder
- func (b *Builder) WithFunc(name string, function interface{}) *Builder
- func (b *Builder) WithOptions(options template.Options) *Builder
- func (b *Builder) WithStderr(w io.Writer) *Builder
- func (b *Builder) WithStdin(r io.Reader) *Builder
- func (b *Builder) WithStdout(w io.Writer) *Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder collects options until it's run
func Command ¶
Command returns a fluent builder for running a command where the command string can have template functions and arguments
func (*Builder) InheritEnvs ¶
InheritEnvs determines whether the process should inherit the envs of the parent
func (*Builder) Prepare ¶
Prepare generates the command based on the input args. This is the step before actual Start or Run
func (*Builder) StartWithHandlers ¶
func (b *Builder) StartWithHandlers(stdinFunc func(io.Writer) error, stdoutFunc func(io.Reader) error, stderrFunc func(io.Reader) error, args ...interface{}) error
StartWithHandlers starts the cmd non blocking and calls the given handlers to process input / output
func (*Builder) WithArg ¶
WithArg sets the arg key, value pair that can be accessed via the 'arg' function
func (*Builder) WithContext ¶
WithContext sets the context of the template
func (*Builder) WithOptions ¶
WithOptions adds the template options
func (*Builder) WithStderr ¶
WithStderr sets the stderr writer