Documentation
¶
Index ¶
- func Exists(name string) bool
- func MustRun(name string, args ...string) string
- func RunBash(script string) (string, error)
- func RunBashInDir(dir, script string) (string, error)
- func RunInDir(dir, name string, args ...string) (string, error)
- func RunSimple(name string, args ...string) (string, error)
- func RunWithEnv(env []string, name string, args ...string) (string, error)
- type Command
- func (c *Command) CombinedOutput() (string, error)
- func (c *Command) Dir(dir string) *Command
- func (c *Command) Env(env ...string) *Command
- func (c *Command) Environment() []string
- func (c *Command) Output() (string, error)
- func (c *Command) Run() *Result
- func (c *Command) RunContext(ctx context.Context) *Result
- func (c *Command) RunStreaming(opts StreamOptions) *Result
- func (c *Command) Start() (*Process, error)
- func (c *Command) Stdin(r io.Reader) *Command
- func (c *Command) String() string
- func (c *Command) Timeout(d time.Duration) *Command
- type ContainerInfo
- type Docker
- type Grove
- func (g *Grove) AgentDown() error
- func (g *Grove) AgentUp(detached bool) error
- func (g *Grove) InDir(dir string) *Grove
- func (g *Grove) Output(args ...string) (string, error)
- func (g *Grove) Run(args ...string) *Result
- func (g *Grove) ServiceDown(service string) error
- func (g *Grove) ServiceUp(service string, detached bool) error
- func (g *Grove) Status() (string, error)
- type Process
- type Result
- func (r *Result) AssertExitCode(expectedCode int) error
- func (r *Result) AssertFailure() error
- func (r *Result) AssertStderrContains(patterns ...string) error
- func (r *Result) AssertStderrEmpty() error
- func (r *Result) AssertStderrNotContains(patterns ...string) error
- func (r *Result) AssertStdoutContains(patterns ...string) error
- func (r *Result) AssertStdoutEmpty() error
- func (r *Result) AssertStdoutNotContains(patterns ...string) error
- func (r *Result) AssertSuccess() error
- type StreamHandler
- type StreamOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunBashInDir ¶
RunBashInDir runs a bash script in a specific directory
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command represents a command to execute
func (*Command) CombinedOutput ¶
CombinedOutput runs the command and returns combined stdout/stderr
func (*Command) Environment ¶
Environment returns the environment variables set for this command
func (*Command) RunContext ¶
RunContext executes the command with a custom context
func (*Command) RunStreaming ¶
func (c *Command) RunStreaming(opts StreamOptions) *Result
RunStreaming executes the command with streaming output
type ContainerInfo ¶
ContainerInfo represents basic container information
type Docker ¶
type Docker struct{}
Docker provides helpers for docker commands
func (*Docker) ContainerExists ¶
ContainerExists checks if a container exists
func (*Docker) ListContainers ¶
func (d *Docker) ListContainers(filter string) ([]ContainerInfo, error)
ListContainers lists running containers
func (*Docker) RemoveContainer ¶
RemoveContainer removes a container
func (*Docker) StopContainer ¶
StopContainer stops a container
type Grove ¶
type Grove struct {
// contains filtered or unexported fields
}
Grove provides helpers for running grove commands
func (*Grove) ServiceDown ¶
ServiceDown stops a service
type Process ¶
Process represents a running background command.
type Result ¶
Result contains the output and status of a command execution
func (*Result) AssertExitCode ¶
AssertExitCode asserts that the command exited with the specified code.
func (*Result) AssertFailure ¶
AssertFailure asserts that the command failed (non-zero exit code or error).
func (*Result) AssertStderrContains ¶
AssertStderrContains asserts that stderr contains all the specified patterns.
func (*Result) AssertStderrEmpty ¶
AssertStderrEmpty asserts that stderr is empty.
func (*Result) AssertStderrNotContains ¶
AssertStderrNotContains asserts that stderr does not contain any of the specified patterns.
func (*Result) AssertStdoutContains ¶
AssertStdoutContains asserts that stdout contains all the specified patterns. Returns the first assertion error encountered, or nil if all patterns are found.
func (*Result) AssertStdoutEmpty ¶
AssertStdoutEmpty asserts that stdout is empty.
func (*Result) AssertStdoutNotContains ¶
AssertStdoutNotContains asserts that stdout does not contain any of the specified patterns.
func (*Result) AssertSuccess ¶
AssertSuccess asserts that the command succeeded (exit code 0, no error).
type StreamHandler ¶
StreamHandler is called for each line of output
type StreamOptions ¶
type StreamOptions struct {
Handler StreamHandler
BufferSize int
CombineOutput bool
}
StreamOptions configures output streaming