Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KillAllByName ¶ added in v0.0.4
KillAllByName kills all running processes that match the given executable name This is useful for cleanup when multiple instances might be running
Types ¶
type GoRun ¶
type GoRun struct {
*GoRunConfig
Cmd *exec.Cmd
// contains filtered or unexported fields
}
func New ¶
func New(c *GoRunConfig) *GoRun
func (*GoRun) GetOutput ¶ added in v0.0.5
GetOutput returns the captured output in a thread-safe manner
func (*GoRun) GetPID ¶ added in v0.0.4
GetPID returns the process ID if the program is running, otherwise returns 0
func (*GoRun) RunProgram ¶
func (*GoRun) StopProgram ¶
func (*GoRun) StopProgramAndCleanup ¶ added in v0.0.4
StopProgramAndCleanup stops the current program and optionally kills all instances of the same executable name
type GoRunConfig ¶
type SafeBuffer ¶ added in v0.0.5
type SafeBuffer struct {
// contains filtered or unexported fields
}
SafeBuffer provides thread-safe operations on a bytes.Buffer and optionally forwards writes to another writer
func NewSafeBuffer ¶ added in v0.0.5
func NewSafeBuffer() *SafeBuffer
NewSafeBuffer creates a new thread-safe buffer
func NewSafeBufferWithForward ¶ added in v0.0.5
func NewSafeBufferWithForward(forward io.Writer) *SafeBuffer
NewSafeBufferWithForward creates a new thread-safe buffer that forwards writes
func (*SafeBuffer) Len ¶ added in v0.0.5
func (sb *SafeBuffer) Len() int
Len returns the length of the buffer in a thread-safe manner
func (*SafeBuffer) Reset ¶ added in v0.0.5
func (sb *SafeBuffer) Reset()
Reset resets the buffer in a thread-safe manner
func (*SafeBuffer) String ¶ added in v0.0.5
func (sb *SafeBuffer) String() string
String returns the contents of the buffer as a string in a thread-safe manner