Documentation ¶
Index ¶
- Constants
- func Close(closer io.Closer)
- func FindFreePort() int
- func IndentJson(in string) string
- func LogG(format string, a ...interface{})
- func WaitUntilSuccess(maxWait WaitTime, f func() error) error
- type CmdBuilder
- func (cb *CmdBuilder) CaptureStderr(out *strings.Builder) *CmdBuilder
- func (cb *CmdBuilder) CaptureStdout(out *strings.Builder) *CmdBuilder
- func (cb *CmdBuilder) Env(name string, value string) *CmdBuilder
- func (cb *CmdBuilder) NoTimeout() *CmdBuilder
- func (cb *CmdBuilder) PrintCommand() *CmdBuilder
- func (cb *CmdBuilder) PrintOutput() *CmdBuilder
- func (cb *CmdBuilder) PrintStderr() *CmdBuilder
- func (cb *CmdBuilder) PrintStdout() *CmdBuilder
- func (cb *CmdBuilder) Run() error
- func (cb *CmdBuilder) StartAsync() error
- func (cb *CmdBuilder) StopAsync() error
- func (cb *CmdBuilder) String() string
- func (cb *CmdBuilder) Timeout(t time.Duration) *CmdBuilder
- type WaitTime
Constants ¶
const ( // Use for operations which are expected to succeed quickly. SmallWait = WaitTime(5 * time.Second) // Use for operators that can take a little while to start working. MedWait = WaitTime(30 * time.Second) // Use for operations which can take a while to succeed. LongWait = WaitTime(70 * time.Second) // Should not be used! Might be useful during development. LongestWait = WaitTime(200 * time.Second) )
const DefaultTimeout = 15 * time.Second
Variables ¶
This section is empty.
Functions ¶
func FindFreePort ¶
func FindFreePort() int
Returns a free TCP port on the local machine or an error
func IndentJson ¶
func LogG ¶
func LogG(format string, a ...interface{})
LogG logs to the ginkgo writer. On test failure, it will print out whatever was written to it.
func WaitUntilSuccess ¶
Repeatedly runs a function, sleeping for a bit after each time, until it returns nil or reaches maxRepeats.
Types ¶
type CmdBuilder ¶
type CmdBuilder struct {
// contains filtered or unexported fields
}
func Cmd ¶
func Cmd(name string, args ...string) *CmdBuilder
func (*CmdBuilder) CaptureStderr ¶
func (cb *CmdBuilder) CaptureStderr(out *strings.Builder) *CmdBuilder
func (*CmdBuilder) CaptureStdout ¶
func (cb *CmdBuilder) CaptureStdout(out *strings.Builder) *CmdBuilder
func (*CmdBuilder) Env ¶
func (cb *CmdBuilder) Env(name string, value string) *CmdBuilder
func (*CmdBuilder) NoTimeout ¶
func (cb *CmdBuilder) NoTimeout() *CmdBuilder
func (*CmdBuilder) PrintCommand ¶
func (cb *CmdBuilder) PrintCommand() *CmdBuilder
PrintCommand will cause the command and its arguments to be printed before it executes.
func (*CmdBuilder) PrintOutput ¶
func (cb *CmdBuilder) PrintOutput() *CmdBuilder
func (*CmdBuilder) PrintStderr ¶
func (cb *CmdBuilder) PrintStderr() *CmdBuilder
func (*CmdBuilder) PrintStdout ¶
func (cb *CmdBuilder) PrintStdout() *CmdBuilder
func (*CmdBuilder) Run ¶
func (cb *CmdBuilder) Run() error
Run starts and then waits for a process to finish.
func (*CmdBuilder) StartAsync ¶
func (cb *CmdBuilder) StartAsync() error
StartAsync starts the process without waiting for its results. It will check it hasn't immediately died. Use StopAsync() to stop and wait for the results.
func (*CmdBuilder) StopAsync ¶
func (cb *CmdBuilder) StopAsync() error
StopAsync stops a process started with StartAsync(). It will send a SIGTERM and ensure the process stops. It will only return an error if the process fails to stop.
func (*CmdBuilder) String ¶
func (cb *CmdBuilder) String() string
func (*CmdBuilder) Timeout ¶
func (cb *CmdBuilder) Timeout(t time.Duration) *CmdBuilder