Documentation ¶
Index ¶
Constants ¶
const BufioScannerBufferSize = 10 * 1024 * 1024
Setting the buffer size to 10mb
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Line ¶ added in v0.19.5
type Line struct { // Line is the contents of the line (without the newline). Line string // Err is set if there was an error. Err error }
Line represents a line that was output from a shell command.
type LocalExec ¶
type LocalExec struct{}
func (LocalExec) CombinedOutput ¶
func (e LocalExec) CombinedOutput(args []string, envs map[string]string, workdir string) (string, error)
CombinedOutput encapsulates creating a command and running it. We should think about how to flexibly add parameters here as this is meant to satisfy very simple usecases for more complex usecases we can add a Command function to this method which will allow us to edit a Cmd directly.
type LocalFilePath ¶
type LocalFilePath string
func (LocalFilePath) Join ¶
func (fp LocalFilePath) Join(elem ...string) FilePath
func (LocalFilePath) NotExists ¶
func (fp LocalFilePath) NotExists() bool
func (LocalFilePath) Resolve ¶
func (fp LocalFilePath) Resolve() string
type ShellCommandRunner ¶ added in v0.19.5
type ShellCommandRunner struct {
// contains filtered or unexported fields
}
ShellCommandRunner runs a command via `exec.Command` and streams output to the `ProjectCommandOutputHandler`.
func NewShellCommandRunner ¶ added in v0.19.5
func NewShellCommandRunner(command string, environ []string, workingDir string, streamOutput bool, outputHandler jobs.ProjectCommandOutputHandler) *ShellCommandRunner
func (*ShellCommandRunner) Run ¶ added in v0.19.5
func (s *ShellCommandRunner) Run(ctx command.ProjectContext) (string, error)
func (*ShellCommandRunner) RunCommandAsync ¶ added in v0.19.5
func (s *ShellCommandRunner) RunCommandAsync(ctx command.ProjectContext) (chan<- string, <-chan Line)
RunCommandAsync runs terraform with args. It immediately returns an input and output channel. Callers can use the output channel to get the realtime output from the command. Callers can use the input channel to pass stdin input to the command. If any error is passed on the out channel, there will be no further output (so callers are free to exit).