models

package
v0.19.5-pre.20220628 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BufioScannerBufferSize = 10 * 1024 * 1024

Setting the buffer size to 10mb

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

type Exec interface {
	LookPath(file string) (string, error)
	CombinedOutput(args []string, envs map[string]string, workdir string) (string, error)
}

type FilePath

type FilePath interface {
	NotExists() bool
	Join(elem ...string) FilePath
	Symlink(newname string) (FilePath, error)
	Resolve() string
}

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.

func (LocalExec) LookPath

func (e LocalExec) LookPath(file string) (string, error)

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
func (fp LocalFilePath) Symlink(newname string) (FilePath, error)

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 (*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).

Directories

Path Synopsis
matchers
Code generated by pegomock.
Code generated by pegomock.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL